aboutsummaryrefslogtreecommitdiffstats
path: root/android/module.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-02-06 16:57:45 -0800
committerColin Cross <ccross@android.com>2020-02-06 17:41:19 -0800
commit6961a491a551178e4dfd6c345f35e2530e399eb8 (patch)
tree7a6855ef4c7b495602dab000e8d96358693f2a59 /android/module.go
parent387ad5c5761c45f36cb745d455163e5b367f77de (diff)
downloadbuild_soong-6961a491a551178e4dfd6c345f35e2530e399eb8.tar.gz
build_soong-6961a491a551178e4dfd6c345f35e2530e399eb8.tar.bz2
build_soong-6961a491a551178e4dfd6c345f35e2530e399eb8.zip
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
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/android/module.go b/android/module.go
index 96c2e1e9..15f3b561 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