Fix AbstractList.removeRange

This commit is contained in:
Alexey Andreev 2018-06-29 16:45:21 +03:00
parent 7511eea1cb
commit 2eea5cba5e

View File

@ -18,11 +18,6 @@ package org.teavm.classlib.java.util;
import org.teavm.classlib.java.lang.*; import org.teavm.classlib.java.lang.*;
import org.teavm.interop.Rename; import org.teavm.interop.Rename;
/**
*
* @author Alexey Andreev
* @param <E>
*/
public abstract class TAbstractList<E> extends TAbstractCollection<E> implements TList<E> { public abstract class TAbstractList<E> extends TAbstractCollection<E> implements TList<E> {
protected transient int modCount; protected transient int modCount;
@ -155,8 +150,11 @@ public abstract class TAbstractList<E> extends TAbstractCollection<E> implements
} }
protected void removeRange(int start, int end) { protected void removeRange(int start, int end) {
for (int i = start; i < end; i++) { TListIterator<E> iterator = listIterator(start);
remove(i); int sz = end - start;
for (int i = 0; i < sz; i++) {
iterator.next();
iterator.remove();
} }
} }