summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2023-08-11 23:33:05 +0000
committer Jihoon Kang <jihoonkang@google.com> 2023-08-11 23:36:11 +0000
commit478ca5b79e3e438a04bd838c9e1f17769d728e92 (patch)
tree5bac8baeb874be0d860f062a3384fc5c7f1f4f53 /java/java.go
parent84473f55d71b06e5b676e08eb8c7d0ee0561351f (diff)
Move scopeOrderedSourceFileNames as outside var
This change enables scopeOrderedSourceFileNames to be not computed everytime when the function is called, but instead is computed once. Test: m Bug: 295429988 Change-Id: I33846cdb7a750e44e45049dbd342aa6ab8b70c4c
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/java.go b/java/java.go
index 988a07492..6667a52f1 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1812,14 +1812,14 @@ func (al *ApiLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
}
}
+// API signature file names sorted from
+// the narrowest api scope to the widest api scope
+var scopeOrderedSourceFileNames = allApiScopes.Strings(
+ func(s *apiScope) string { return s.apiFilePrefix + "current.txt" })
+
func (al *ApiLibrary) sortApiFilesByApiScope(ctx android.ModuleContext, srcFiles android.Paths) android.Paths {
sortedSrcFiles := android.Paths{}
- // API signature file name sorted from
- // the narrowest api scope to the widest api scope
- scopeOrderedSourceFileNames := allApiScopes.Strings(
- func(s *apiScope) string { return s.apiFilePrefix + "current.txt" })
-
for _, scopeSourceFileName := range scopeOrderedSourceFileNames {
for _, sourceFileName := range srcFiles {
if sourceFileName.Base() == scopeSourceFileName {