mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-25 02:19:45 +01:00
fixed ConcurrentModificationException in clear()
This commit is contained in:
parent
e343074240
commit
62421e87cc
@ -105,9 +105,8 @@ public class ShipMap {
|
|||||||
* Removes all items from the map and triggers corresponding removal events for each.
|
* Removes all items from the map and triggers corresponding removal events for each.
|
||||||
*/
|
*/
|
||||||
public void clear() {
|
public void clear() {
|
||||||
for (Item item : items) {
|
while (!items.isEmpty()) {
|
||||||
items.remove(item);
|
notifyListeners(new ItemRemovedEvent(items.removeFirst(), this));
|
||||||
notifyListeners(new ItemRemovedEvent(item, this));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user