Fix product variable zero value check
The zero value check was being done by using reflect.DeepEqual on a field from the default product variables, but this results in comparison against a random type when the product variables struct for the module has been filtered down. Luckily this will always fail false, which just removed and optimization but left the behavior correct. Use reflect.IsZero instead, which is both faster and correct. Test: variable_test.go Change-Id: Ieaaa590c2788ca39230e6695397e8ba8d1c6c103
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user