Skip to content

Commit

Permalink
Use SkipList iterator in ItemList instead of fastutil iterator (#556)
Browse files Browse the repository at this point in the history
The fastutil iterator does not support external removal or pushing to the Set which might happen and will cause crashes
  • Loading branch information
tth05 authored Aug 21, 2024
1 parent c253bdd commit 37ee437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/appeng/util/item/ItemList.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public int size() {
public Iterator<IAEItemStack> iterator() {
return new MeaningfulItemIterator<>(new Iterator<>() {

private final Iterator<IAEItemStack> i = ItemList.this.setRecords.iterator();
private final Iterator<IAEItemStack> i = ItemList.this.records.values().iterator();
private IAEItemStack next = null;

@Override
Expand All @@ -195,7 +195,7 @@ public IAEItemStack next() {
@Override
public void remove() {
i.remove();
ItemList.this.records.remove(next);
ItemList.this.setRecords.remove(next);
}
});
}
Expand Down

0 comments on commit 37ee437

Please sign in to comment.