summaryrefslogtreecommitdiff
path: root/libs/androidfw/ApkParsing.cpp
diff options
context:
space:
mode:
author Jan Sebechlebsky <jsebechlebsky@google.com> 2022-11-28 19:05:23 +0100
committer Ján Sebechlebský <jsebechlebsky@google.com> 2022-12-01 09:17:25 +0000
commit740710388b1a759a12938ad6ab9706bdf8723c81 (patch)
treee762b120889c069884d2bc3178f112e8eddd031e /libs/androidfw/ApkParsing.cpp
parente87964faa5818fadc66ed9276d8819b814ee7a51 (diff)
Change contentEquals implementation to operate in O(n) time.
Calling other.get(key) does binary search in the "other" instance to look up the key, but this is not necessary, since if the two instances are equal, they will contain same keys with same values in exact same order. The cl also does some other minor changes: * avoid unnecessary method calls / bounds check in contentEquals. * avoid unnecessary method calls / bounds check / autoboxing in contentHashCode. It's possible that some of these would be done by AOT / JIT optimizations, but they generally tend to have some cost in Java. Test: atest SparseArrayTest Bug: 260964842 Change-Id: I060ea39e85056a86e986a0fe61d153c18c234f4b
Diffstat (limited to 'libs/androidfw/ApkParsing.cpp')
0 files changed, 0 insertions, 0 deletions