Change jsonVariationMap to array of struct am: 8097d1a0e6
am: 465668494e
am: b753906270
am: 353186f043
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2059708 Change-Id: Id1f08f199555d2e09fbd1daa6ce37c7369e1200e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
bb15015143
1 changed files with 12 additions and 2 deletions
14
context.go
14
context.go
|
@ -2268,7 +2268,7 @@ func (c *Context) updateDependencies() (errs []error) {
|
|||
return
|
||||
}
|
||||
|
||||
type jsonVariationMap map[string]string
|
||||
type jsonVariationMap []Variation
|
||||
|
||||
type jsonModuleName struct {
|
||||
Name string
|
||||
|
@ -2290,7 +2290,17 @@ type JsonModule struct {
|
|||
}
|
||||
|
||||
func toJsonVariationMap(vm variationMap) jsonVariationMap {
|
||||
return jsonVariationMap(vm)
|
||||
m := make(jsonVariationMap, 0, len(vm))
|
||||
for k, v := range vm {
|
||||
m = append(m, Variation{k, v})
|
||||
}
|
||||
sort.Slice(m, func(i, j int) bool {
|
||||
if m[i].Mutator != m[j].Mutator {
|
||||
return m[i].Mutator < m[j].Mutator
|
||||
}
|
||||
return m[i].Variation < m[j].Variation
|
||||
})
|
||||
return m
|
||||
}
|
||||
|
||||
func jsonModuleNameFromModuleInfo(m *moduleInfo) *jsonModuleName {
|
||||
|
|
Loading…
Reference in a new issue