Fix FirstUniqueStrings after conversion to generics

The conversion of FirstUniqueStrings to be implemented on top of the
generic firstUnique accidentally used a different threshold to switch
from the list implementation to the map implementation.  Modify the
threshold of firstUnique to match the old value from FirstUniqueStrings
now that it doesn't have the reflection overhead.  While we're at it,
also make firstUnique make a copy of the list, and make FirstUniqueStrings
a pure wrapper around firstUnique.

Test: BenchmarkFirstUniqueStrings
Change-Id: Icc2febea663142c508ff2e4be65a8a68121631d5
This commit is contained in:
Colin Cross
2023-06-27 09:45:26 -07:00
parent c85750bfe3
commit 48016d5a2f
6 changed files with 18 additions and 29 deletions

View File

@@ -630,5 +630,3 @@ func contains(l []string, s string) bool {
}
return false
}
var copyOf = android.CopyOf