From 76f495a796fdc6663d2631df7f28c9edeea736fc Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 12 Jun 2015 01:49:53 +0200 Subject: Move assignment to 'write_to_conf' to later. It's always False for symbols with UNKNOWN type, so no need to re-set it. Add a comment too. --- kconfiglib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 7dbfc60..f259b0a 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1850,8 +1850,6 @@ class Symbol(Item): if self.cached_val is not None: return self.cached_val - self.write_to_conf = False - # As a quirk of Kconfig, undefined symbols get their name as their # value. This is why things like "FOO = bar" work for seeing if FOO has # the value "bar". @@ -1860,9 +1858,11 @@ class Symbol(Item): return self.name new_val = default_value[self.type] - vis = _get_visibility(self) + # This is easiest to calculate together with the value + self.write_to_conf = False + if self.type == BOOL or self.type == TRISTATE: # The visibility and mode (modules-only or single-selection) of # choice items will be taken into account in _get_visibility() -- cgit v1.2.3