summaryrefslogtreecommitdiff
path: root/java/platform_bootclasspath.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2023-04-25 18:03:54 +0000
committer Spandan Das <spandandas@google.com> 2023-04-25 18:37:24 +0000
commit8a8714c781175f8f1a6c189d919ee8b0ee8c1e27 (patch)
treec8981afb91ab15caace517ef01a1477ec303df98 /java/platform_bootclasspath.go
parent00bafc669386e63ffa4b87b75b47339ef4a0063a (diff)
Do not modify input in-place
SortedUniqueStrings and FirstUniqueStrings dedupes repeating elements and returns the deduped list. Currently, it also modifies the input list in-place, which causes non-determinisitc failures like b/275313114 Operate on a copy of the input so that the input remains untouched. SortedUniqueStrings is O(NlogN) and FirstUniqueStrings is ~O(N), so creating a copy (O(N)) should not result in major performance regressions. Numbers for this single unit test: ``` go test . -run TestStubsForLibraryInMultipleApexes -v -count 1000 Before: 174s After: 172s ``` Test: go test ./android Test: go test . -run TestStubsForLibraryInMultipleApexes -v -count 1000 Change-Id: Id859723b2c2ebdc0023876c4b6fabe75d870bad7
Diffstat (limited to 'java/platform_bootclasspath.go')
0 files changed, 0 insertions, 0 deletions