Skip to content
Commit 2c31b675 authored by Kweku Adams's avatar Kweku Adams
Browse files

Simplifying removeAll method.

JobStore.removeAll() iterates through an ArraySet and removes jobs that
satisfy a predicate. The repeated removals will cause ArraySet to do
many System.arraycopy calls and could cause the ArraySet to resize its
internal array several times during the iteration. ArraySet has a
removeIf(Predicate) method which does this exact task without repeatedly
resizing the array or doing many System.arraycopy calls. Switching to
ArraySet.removeIf will reduce the amount of code and improve performance
in some cases.

Bug: 141645789
Test: atest com.android.server.job.JobStoreTest
Change-Id: Icbdcda219c115288d13a3508e8b4762783301eb0
parent 69235dcb
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