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

Commit 137b460e authored by Tobias Thierer's avatar Tobias Thierer Committed by Android (Google) Code Review
Browse files

Merge "Don't allow MapCollections to iterate past the end."

parents 07be4d67 093572cd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;

/**
@@ -52,6 +53,7 @@ abstract class MapCollections<K, V> {

        @Override
        public T next() {
            if (!hasNext()) throw new NoSuchElementException();
            Object res = colGetEntry(mIndex, mOffset);
            mIndex++;
            mCanRemove = true;
@@ -87,6 +89,7 @@ abstract class MapCollections<K, V> {

        @Override
        public Map.Entry<K, V> next() {
            if (!hasNext()) throw new NoSuchElementException();
            mIndex++;
            mEntryValid = true;
            return this;