summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorWinson <chiuwinson@google.com>2019-03-18 13:07:29 -0700
committerWinson <chiuwinson@google.com>2019-03-18 13:20:21 -0700
commit3b0962aa662d7f72e20dfc21e5f2af3208d6f1e7 (patch)
treef0d7c152175f8827d442940c3f8d51a79d40d6ac /tools/aapt2/java/JavaClassGenerator_test.cpp
parenta232a7abe60261bcbbfa2bc998bae0a1fde13fb7 (diff)
Make PackageKetSetData use erase
In ArrayMap, it's possible to manually iterate the backing array but the behavior is undefined when you start removing values that don't actually exist in the map. It doesn't resize on every removal, so it's possible to add N values, remove > 1, and then successfully remove N-1, although it realistically does nothing but null an already null element. This depends on how the map has decided to resize itself, and may or may not crash. This uses erase rather than clear to prevent clearing and re-allocating the array. The common use case is simply replacing the values in the map, so this preserves size. Bug: 128012139 Test: manual test removeAllDefinedKeySets Change-Id: I8fe75ba64ebd2a97c668249301517abb57627101
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions