Merge "Remove unused functions" am: c42b19f0a8
am: 27c1ec557b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1924157 Change-Id: I0d3f6aab7ad4d5ad711c6786fe7fc7a22f580b11
This commit is contained in:
commit
b265dff352
1 changed files with 0 additions and 31 deletions
|
@ -65,22 +65,6 @@ func JoinWithSuffix(strs []string, suffix string, separator string) string {
|
||||||
return buf.String()
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SortedIntKeys returns the keys of the given integer-keyed map in the ascending order
|
|
||||||
// TODO(asmundak): once Go has generics, combine this with SortedStringKeys below.
|
|
||||||
func SortedIntKeys(m interface{}) []int {
|
|
||||||
v := reflect.ValueOf(m)
|
|
||||||
if v.Kind() != reflect.Map {
|
|
||||||
panic(fmt.Sprintf("%#v is not a map", m))
|
|
||||||
}
|
|
||||||
keys := v.MapKeys()
|
|
||||||
s := make([]int, 0, len(keys))
|
|
||||||
for _, key := range keys {
|
|
||||||
s = append(s, int(key.Int()))
|
|
||||||
}
|
|
||||||
sort.Ints(s)
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// SorterStringKeys returns the keys of the given string-keyed map in the ascending order
|
// SorterStringKeys returns the keys of the given string-keyed map in the ascending order
|
||||||
func SortedStringKeys(m interface{}) []string {
|
func SortedStringKeys(m interface{}) []string {
|
||||||
v := reflect.ValueOf(m)
|
v := reflect.ValueOf(m)
|
||||||
|
@ -96,21 +80,6 @@ func SortedStringKeys(m interface{}) []string {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// SortedStringMapValues returns the values of the string-values map in the ascending order
|
|
||||||
func SortedStringMapValues(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, v.MapIndex(key).String())
|
|
||||||
}
|
|
||||||
sort.Strings(s)
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// IndexList returns the index of the first occurrence of the given string in the list or -1
|
// IndexList returns the index of the first occurrence of the given string in the list or -1
|
||||||
func IndexList(s string, list []string) int {
|
func IndexList(s string, list []string) int {
|
||||||
for i, l := range list {
|
for i, l := range list {
|
||||||
|
|
Loading…
Reference in a new issue