diff options
Diffstat (limited to 'core/java/android/util/ArrayMap.java')
| -rw-r--r-- | core/java/android/util/ArrayMap.java | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/core/java/android/util/ArrayMap.java b/core/java/android/util/ArrayMap.java index e2af6f5ed102..436cb4ff7072 100644 --- a/core/java/android/util/ArrayMap.java +++ b/core/java/android/util/ArrayMap.java @@ -16,12 +16,12 @@ package android.util; +import libcore.util.EmptyArray; + import android.annotation.UnsupportedAppUsage; import com.android.internal.util.ArrayUtils; -import libcore.util.EmptyArray; - import java.util.Collection; import java.util.ConcurrentModificationException; import java.util.Map; @@ -453,10 +453,6 @@ public final class ArrayMap<K, V> implements Map<K, V> { * @return Returns the key stored at the given index. */ public K keyAt(int index) { - if (index >= mSize) { - // The array might be slightly bigger than mSize, in which case, indexing won't fail. - throw new ArrayIndexOutOfBoundsException(index); - } return (K)mArray[index << 1]; } @@ -466,10 +462,6 @@ public final class ArrayMap<K, V> implements Map<K, V> { * @return Returns the value stored at the given index. */ public V valueAt(int index) { - if (index >= mSize) { - // The array might be slightly bigger than mSize, in which case, indexing won't fail. - throw new ArrayIndexOutOfBoundsException(index); - } return (V)mArray[(index << 1) + 1]; } @@ -480,10 +472,6 @@ public final class ArrayMap<K, V> implements Map<K, V> { * @return Returns the previous value at the given index. */ public V setValueAt(int index, V value) { - if (index >= mSize) { - // The array might be slightly bigger than mSize, in which case, indexing won't fail. - throw new ArrayIndexOutOfBoundsException(index); - } index = (index << 1) + 1; V old = (V)mArray[index]; mArray[index] = value; @@ -677,11 +665,6 @@ public final class ArrayMap<K, V> implements Map<K, V> { * @return Returns the value that was stored at this index. */ public V removeAt(int index) { - if (index >= mSize) { - // The array might be slightly bigger than mSize, in which case, indexing won't fail. - throw new ArrayIndexOutOfBoundsException(index); - } - final Object old = mArray[(index << 1) + 1]; final int osize = mSize; final int nsize; |
