diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-02-27 13:45:51 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-02-27 13:46:57 +0100 |
| commit | 3bb590dc48f493b81775b377299823a5a314e01f (patch) | |
| tree | ade1516fa6d4decc08f37f63aa1e54d2a6e1808b /kconfiglib.py | |
| parent | 4dc34b27b0040eadcb139ee281df2458a642588e (diff) | |
Move sym._written setting earlier
Makes the logic a bit clearer, and might save some branching.
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index c246cdc..b676d4e 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -849,6 +849,7 @@ class Kconfig(object): for sym in self.defined_syms: if not sym._written: + sym._written = True # Note: _write_to_conf is determined when the value is # calculated. This is a hidden function call due to # property magic. @@ -878,8 +879,6 @@ class Kconfig(object): 'header: unknown type "{}".' .format(sym.orig_type)) - sym._written = True - def write_config(self, filename, header="# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\n"): r""" @@ -930,10 +929,10 @@ class Kconfig(object): item = node.item if isinstance(item, Symbol): if not item._written: + item._written = True config_string = item.config_string if config_string: write(config_string) - item._written = True elif expr_value(node.dep) and \ ((item == MENU and expr_value(node.visibility)) or |
