am 967439b4: Merge "Make ArrayMap.EMPTY immutable" into lmp-mr1-dev

automerge: abc88d0

* commit 'abc88d0743924441bf7fcd3085e3305b076f5af5':
  Make ArrayMap.EMPTY immutable
This commit is contained in:
Adam Lesinski
2015-02-05 23:05:40 +00:00
committed by android-build-merger

View File

@@ -255,7 +255,10 @@ public final class ArrayMap<K, V> implements Map<K, V> {
}
private ArrayMap(boolean immutable) {
mHashes = EmptyArray.INT;
// If this is immutable, use the sentinal EMPTY_IMMUTABLE_INTS
// instance instead of the usual EmptyArray.INT. The reference
// is checked later to see if the array is allowed to grow.
mHashes = immutable ? EMPTY_IMMUTABLE_INTS : EmptyArray.INT;
mArray = EmptyArray.OBJECT;
mSize = 0;
}