From 48016d5a2f3d0a518de795e4eba6d899628a86bb Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 27 Jun 2023 09:45:26 -0700 Subject: 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 --- java/dexpreopt_config.go | 2 -- java/robolectric.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'java') diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go index 9100e87c6..28f50d7e3 100644 --- a/java/dexpreopt_config.go +++ b/java/dexpreopt_config.go @@ -250,8 +250,6 @@ func bcpForDexpreopt(ctx android.PathContext, withUpdatable bool) (android.Writa var defaultBootclasspathKey = android.NewOnceKey("defaultBootclasspath") -var copyOf = android.CopyOf - func init() { android.RegisterMakeVarsProvider(pctx, dexpreoptConfigMakevars) } diff --git a/java/robolectric.go b/java/robolectric.go index 6bbe872bb..0041af429 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -299,7 +299,7 @@ func generateSameDirRoboTestConfigJar(ctx android.ModuleContext, outputFile andr func (r *robolectricTest) generateRoboSrcJar(ctx android.ModuleContext, outputFile android.WritablePath, instrumentedApp *AndroidApp) { - srcJarArgs := copyOf(instrumentedApp.srcJarArgs) + srcJarArgs := android.CopyOf(instrumentedApp.srcJarArgs) srcJarDeps := append(android.Paths(nil), instrumentedApp.srcJarDeps...) for _, m := range ctx.GetDirectDepsWithTag(roboCoverageLibsTag) { -- cgit v1.2.3-59-g8ed1b