summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2015-05-11 13:23:31 -0700
committerDoris Liu <tianliu@google.com>2015-05-11 13:23:31 -0700
commitd7444427d9f44b6b7448d4c21edca866132c8b59 (patch)
tree1161a4d2def82d342503d405cfa95e2e80b339b3
parent8f72b4037022c4f860caafa296e2ac309bde177f (diff)
downloadframeworks_base-d7444427d9f44b6b7448d4c21edca866132c8b59.zip
frameworks_base-d7444427d9f44b6b7448d4c21edca866132c8b59.tar.gz
frameworks_base-d7444427d9f44b6b7448d4c21edca866132c8b59.tar.bz2
Use ArrayMap instead of HashMap for storing relavant nodes
This fix is to take advantage of ArrayMap, which is a key-value mapping data structure that is more memory efficient than HashMap. Bug: 11604254 Change-Id: I57006880de570a4d7f3899e274cf0a06355d116b
-rw-r--r--core/java/android/animation/AnimatorSet.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index 6503d89..951fe49 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -16,9 +16,10 @@
package android.animation;
+import android.util.ArrayMap;
+
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
/**
@@ -68,7 +69,7 @@ public final class AnimatorSet extends Animator {
* to a single node representing that Animator, not create a new Node
* if one already exists.
*/
- private HashMap<Animator, Node> mNodeMap = new HashMap<Animator, Node>();
+ private ArrayMap<Animator, Node> mNodeMap = new ArrayMap<Animator, Node>();
/**
* Set of all nodes created for this AnimatorSet. This list is used upon
@@ -646,7 +647,7 @@ public final class AnimatorSet extends Animator {
anim.mTerminated = false;
anim.mStarted = false;
anim.mPlayingSet = new ArrayList<Animator>();
- anim.mNodeMap = new HashMap<Animator, Node>();
+ anim.mNodeMap = new ArrayMap<Animator, Node>();
anim.mNodes = new ArrayList<Node>(nodeCount);
anim.mSortedNodes = new ArrayList<Node>(nodeCount);
anim.mReversible = mReversible;