Skip to content

Commit

Permalink
Add forgotten negative index check
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jul 23, 2023
1 parent 4acb2dc commit bec7a22
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ private Object2IntMap<AEItemKey> getChain(BulkCellInventory cell) {
Collections.reverse(keys);

var decompressed = new Object2IntLinkedOpenHashMap<AEItemKey>();
var highest = keys.indexOf(cell.getHighestCompressed());

for (var key : keys.subList(keys.indexOf(cell.getHighestCompressed()), keys.size())) {
decompressed.put(key, c.getInt(key));
if (highest > -1) {
for (var key : keys.subList(highest, keys.size())) {
decompressed.put(key, c.getInt(key));
}
}

return decompressed;
Expand Down

0 comments on commit bec7a22

Please sign in to comment.