mirror of
https://github.com/maxkratz/fastutil.git
synced 2024-09-16 11:58:09 +00:00
Fix bug in ImmutableSubList iterator
listIterator() on a sublist needs to correct its index to add "from" to it.
This commit is contained in:
parent
3edb5bcda8
commit
b0f7543eca
1 changed files with 3 additions and 3 deletions
|
@ -535,10 +535,10 @@ public class IMMUTABLE_LIST KEY_GENERIC extends LISTS.ImmutableListBase KEY_GENE
|
|||
|
||||
@Override
|
||||
public KEY_LIST_ITERATOR KEY_GENERIC listIterator(final int index) {
|
||||
ensureIndex(index);
|
||||
ensureRestrictedIndex(index + from);
|
||||
|
||||
return new KEY_LIST_ITERATOR KEY_GENERIC() {
|
||||
int pos = index;
|
||||
int pos = index + from;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() { return pos < to; }
|
||||
|
@ -851,4 +851,4 @@ public class IMMUTABLE_LIST KEY_GENERIC extends LISTS.ImmutableListBase KEY_GENE
|
|||
#endif
|
||||
}
|
||||
|
||||
#undef _EMPTY_ARRAY
|
||||
#undef _EMPTY_ARRAY
|
||||
|
|
Loading…
Reference in a new issue