Replace SortedStringKeys with SortedKeys

Now that we have generics.

Bug: 193460475
Test: presubmits
Change-Id: I1594fd8feb505175d5c09c03ef397e5ffd5b09cb
This commit is contained in:
Cole Faust
2023-02-28 16:02:16 -08:00
parent 20eed826fd
commit 18994c73f1
34 changed files with 104 additions and 85 deletions

View File

@@ -301,23 +301,6 @@ func (defs *Bp2BuildSoongConfigDefinitions) AddVars(mtDef SoongConfigDefinition)
}
}
// This is a copy of the one available in soong/android/util.go, but depending
// on the android package causes a cyclic dependency. A refactoring here is to
// extract common utils out from android/utils.go for other packages like this.
func sortedStringKeys(m interface{}) []string {
v := reflect.ValueOf(m)
if v.Kind() != reflect.Map {
panic(fmt.Sprintf("%#v is not a map", m))
}
keys := v.MapKeys()
s := make([]string, 0, len(keys))
for _, key := range keys {
s = append(s, key.String())
}
sort.Strings(s)
return s
}
// String emits the Soong config variable definitions as Starlark dictionaries.
func (defs Bp2BuildSoongConfigDefinitions) String() string {
ret := ""