From 1e8c6072bb2887d714a666e947ccd6eaa2e20611 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 23 Oct 2020 18:28:55 +0100 Subject: [PATCH] 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 --- android/config.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/android/config.go b/android/config.go index 004b74378..42a286c45 100644 --- a/android/config.go +++ b/android/config.go @@ -1336,11 +1336,6 @@ func (l *ConfiguredJarList) Len() int { 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 @@ func (l *ConfiguredJarList) ContainsJar(jar string) bool { // 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 @@ func (l *ConfiguredJarList) RemoveList(list ConfiguredJarList) { 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 @@ func (l *ConfiguredJarList) CopyOfApexJarPairs() []string { 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) }