OSDN Git Service

Additional functionality and performance for ArrayMap
authorChet Haase <chet@google.com>
Thu, 6 Jun 2013 23:34:33 +0000 (16:34 -0700)
committerChet Haase <chet@google.com>
Thu, 6 Jun 2013 23:43:41 +0000 (16:43 -0700)
commitf4130cf35fa128e36f96e55955d4f5db86197e4a
tree0ae8a2c211bebc906d67402e3aa7e0c5b801babe
parentae8f82f2015612a659b95007c355d12c83fbcefc
Additional functionality and performance for ArrayMap

Added equals() and hashCode() to ArrayMap to allow equals() tests
of maps with the same key/value pairs to return true.

Changed putAll() to handle the case of an empty map faster, just copying
the arrays instead of adding elements one by one.

Added to ArrayMapTests to test new equals() and copy constructor
functionality.

Issue #9299310 Optimize ArrayMap copy constructor

Change-Id: I1186a0eddd1fd53a0f380c2f3972fc1942cdf879
core/java/android/util/ArrayMap.java
tests/ActivityTests/src/com/google/android/test/activity/ArrayMapTests.java