diff options
| -rw-r--r-- | android/module.go | 2 | ||||
| -rw-r--r-- | android/variable.go | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/android/module.go b/android/module.go index 96c2e1e90..15f3b5614 100644 --- a/android/module.go +++ b/android/module.go @@ -539,7 +539,7 @@ func InitAndroidModule(m Module) { // Allow tests to override the default product variables if base.variableProperties == nil { - base.variableProperties = zeroProductVariables + base.variableProperties = defaultProductVariables } // Filter the product variables properties to the ones that exist on this module diff --git a/android/variable.go b/android/variable.go index 9625a879a..165db1cf2 100644 --- a/android/variable.go +++ b/android/variable.go @@ -133,7 +133,7 @@ type variableProperties struct { } `android:"arch_variant"` } -var zeroProductVariables interface{} = variableProperties{} +var defaultProductVariables interface{} = variableProperties{} type productVariables struct { // Suffix to add to generated Makefiles @@ -399,11 +399,9 @@ func variableMutator(mctx BottomUpMutatorContext) { } variableValues := reflect.ValueOf(a.variableProperties).Elem().FieldByName("Product_variables") - zeroValues := reflect.ValueOf(zeroProductVariables).FieldByName("Product_variables") for i := 0; i < variableValues.NumField(); i++ { variableValue := variableValues.Field(i) - zeroValue := zeroValues.Field(i) name := variableValues.Type().Field(i).Name property := "product_variables." + proptools.PropertyNameForField(name) @@ -421,10 +419,9 @@ func variableMutator(mctx BottomUpMutatorContext) { } // Check if any properties were set for the module - if reflect.DeepEqual(variableValue.Interface(), zeroValue.Interface()) { + if variableValue.IsZero() { continue } - a.setVariableProperties(mctx, property, variableValue, val.Interface()) } } |