Skip to content

Commit

Permalink
ArrayList iterator back() bug fix, compute remaining correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
barakugav committed Feb 6, 2024
1 parent 134cee3 commit 54da286
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drv/ArrayList.drv
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ public class ARRAY_LIST KEY_GENERIC extends ABSTRACT_LIST KEY_GENERIC implements
@Override
public int back(int n) {
if (n < 0) throw new IllegalArgumentException("Argument must be nonnegative: " + n);
final int remaining = size - pos;
final int remaining = pos;
if (n < remaining) {
pos -= n;
} else {
Expand Down

0 comments on commit 54da286

Please sign in to comment.