Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9ce29a7b authored by Andreas Gampe's avatar Andreas Gampe Committed by Gerrit Code Review
Browse files

Frameworks/base: Add removeAll for ArraySet

Add a simple ArraySet.removeAll(ArraySet) method. This avoids two
allocations, a MapCollections helper and an Iterator object, over
the removeAll(Collection) code.

KeySetManagerService heavily calls removeAll during boot (about 9K
times in AOSP). This reduces GC stress and optimizes the removal
(about half the time the removed collection has only one element).
The removal method in KeySetManagerService is also done under a lock,
so that it gates parallelization efforts in PackageManagerService.

Bug: 19498314
Change-Id: Ib0e483adfd09831cd66ab19a820ebf6544a2b66f
(cherry picked from commit 165174e0)
parent a805aa21
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