fastutil
fastutil copied to clipboard
Error in ImmutableSubList.ListIterator#hasNext
Example:
var iterator = IntList.of(1, 1).subList(1, 2).iterator();
while (iterator.hasNext()) iterator.nextInt();
throws java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2.
It's reproducible with DoubleList as well. Haven't checked other types though.
Possible workaround: replace IntList with IntArrayList.
Affected version: fastutil-core:8.5.12.
I guess, the problem is in missing addition of from inside hasNext method.
Sounds like a (hopefully) simple fix; I can try to make a merge request for it
Ouch, I completely missed this somehow. Yes, if you can fix it in a PR that'd be great. I'd like to fix a few things and release.