Update ImmutableList.drv

This commit is contained in:
goldfeder 2023-03-13 22:15:41 +02:00 committed by GitHub
parent 9920128c20
commit 1887508645
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,7 +339,7 @@ public class IMMUTABLE_LIST KEY_GENERIC extends LISTS.ImmutableListBase KEY_GENE
@Override
public int back(int n) {
if (n < 0) throw new IllegalArgumentException("Argument must be nonnegative: " + n);
final int remaining = a.length - pos;
final int remaining = pos;
if (n < remaining) {
pos -= n;
} else {
@ -573,7 +573,7 @@ public class IMMUTABLE_LIST KEY_GENERIC extends LISTS.ImmutableListBase KEY_GENE
@Override
public int back(int n) {
if (n < 0) throw new IllegalArgumentException("Argument must be nonnegative: " + n);
final int remaining = to - pos;
final int remaining = pos - from;
if (n < remaining) {
pos -= n;
} else {