Skip to content
Commit 3b0962aa authored by Winson's avatar Winson
Browse files

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
parent a232a7ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment