From 2eea5cba5e296d135f9a54f4a1156893788e70fc Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 29 Jun 2018 16:45:21 +0300 Subject: [PATCH] Fix AbstractList.removeRange --- .../org/teavm/classlib/java/util/TAbstractList.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractList.java b/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractList.java index 7328708ba..db70ab302 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractList.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractList.java @@ -18,11 +18,6 @@ package org.teavm.classlib.java.util; import org.teavm.classlib.java.lang.*; import org.teavm.interop.Rename; -/** - * - * @author Alexey Andreev - * @param - */ public abstract class TAbstractList extends TAbstractCollection implements TList { protected transient int modCount; @@ -155,8 +150,11 @@ public abstract class TAbstractList extends TAbstractCollection implements } protected void removeRange(int start, int end) { - for (int i = start; i < end; i++) { - remove(i); + TListIterator iterator = listIterator(start); + int sz = end - start; + for (int i = 0; i < sz; i++) { + iterator.next(); + iterator.remove(); } }