Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83c7ac3b authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Fix off-by-one issue when removing from Iterator

MapCollections' iterator removes the preceding element
which causes IndexOutOfBoundsExceptions to be thrown
when removing the first element while iterating.

bug:11477476
Change-Id: Ifc8fcf0ca1651e759f3b2ab8356404564e9f7d0b
parent 099d842b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,10 +97,10 @@ abstract class MapCollections<K, V> {
            if (!mEntryValid) {
                throw new IllegalStateException();
            }
            colRemoveAt(mIndex);
            mIndex--;
            mEnd--;
            mEntryValid = false;
            colRemoveAt(mIndex);
        }

        @Override