Remove unnecessary ConfiguredJarList.apex(int) method
This is only used from within the ConfiguredJarList implementation and
provides no real benefit over directly accessing the apexes slices.
Similarly, uses of Jar(int) from within the implementation are also
replaced with direct slice access.
Bug: 171479578
Test: m nothing
Change-Id: I7e799b1049f4a1da4140e55831c4559751278de6
diff --git a/android/config.go b/android/config.go
index 004b743..42a286c 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1336,11 +1336,6 @@
return len(l.jars)
}
-// Apex component of idx-th pair on the list.
-func (l *ConfiguredJarList) apex(idx int) string {
- return l.apexes[idx]
-}
-
// Jar component of idx-th pair on the list.
func (l *ConfiguredJarList) Jar(idx int) string {
return l.jars[idx]
@@ -1354,7 +1349,7 @@
// If the list contains the given (apex, jar) pair.
func (l *ConfiguredJarList) containsApexJarPair(apex, jar string) bool {
for i := 0; i < l.Len(); i++ {
- if apex == l.apex(i) && jar == l.Jar(i) {
+ if apex == l.apexes[i] && jar == l.jars[i] {
return true
}
}
@@ -1378,7 +1373,7 @@
jars := make([]string, 0, l.Len())
for i, jar := range l.jars {
- apex := l.apex(i)
+ apex := l.apexes[i]
if !list.containsApexJarPair(apex, jar) {
apexes = append(apexes, apex)
jars = append(jars, jar)
@@ -1404,7 +1399,7 @@
pairs := make([]string, 0, l.Len())
for i, jar := range l.jars {
- apex := l.apex(i)
+ apex := l.apexes[i]
pairs = append(pairs, apex+":"+jar)
}