Skip to content

Commit bb7905c

Browse files
committed
Fix ArrayList.removeElements
1 parent 1db82d2 commit bb7905c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drv/ArrayList.drv

+3-2
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,11 @@ public class ARRAY_LIST KEY_GENERIC extends ABSTRACT_LIST KEY_GENERIC implements
835835
it.unimi.dsi.fastutil.Arrays.ensureFromTo(size, from, to);
836836
final KEY_TYPE[] a = this.a;
837837
System.arraycopy(a, to, a, from, size - to);
838+
final int newSize = size - (to - from);
838839
#if KEYS_REFERENCE
839-
Arrays.fill(a, to, size, null);
840+
for (int i = newSize; i < size; i++) a[i] = null;
840841
#endif
841-
this.size -= (to - from);
842+
this.size = newSize;
842843
}
843844

844845

0 commit comments

Comments
 (0)