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

Skip to content
Commit d5c4c550 authored by Songchun Fan's avatar Songchun Fan
Browse files

[snapshot] optimizing WatchedArrayList snapshot

ArrayList.add(index, value) does an array copy everytime to extend the
underlying array. Here we already knew the size of that array and
ensured the capacity so we should only call ArrayList.add(value)
which does not involve array copying.

We need to examine other Watched* classes and try to spot performance
issues like this.

BUG: 231373522
Test: forrest run
Change-Id: Iab440fc809072e9b1ee1bef7d69a0dc04207bafb
parent 455e490d
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