summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-11 06:48:57 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-11 06:48:57 +0100
commit6a21927f91a36cb766ab35f6cbb008f565b2d3c9 (patch)
tree51ae9cbbbab574d8de4758e9cb76321e82a7490d
parent6533806afb9bc2fd9660c3116eacdb7f20b43665 (diff)
Only invalidate if the user value actually changes.
-rw-r--r--kconfiglib.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index a6ff7c5..ffae96f 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2455,16 +2455,20 @@ class Symbol(Item, _HasVisibility):
things will just work with regards to dependencies.
v -- The value to give to the symbol."""
+ old_user_val = self.user_val
+
self._set_value_no_invalidate(v, False)
- # There might be something more efficient you could do here, but play
- # it safe.
- if self.name == "MODULES":
- self.config._invalidate_all()
- return
+ # If the user value changed, invalidate all dependent symbols
+ if self.user_val != old_user_val:
+ # There might be something more efficient you could do here, but play
+ # it safe.
+ if self.name == "MODULES":
+ self.config._invalidate_all()
+ return
- self._invalidate()
- self._invalidate_dependent()
+ self._invalidate()
+ self._invalidate_dependent()
def reset(self):
"""Resets the value of the symbol, as if the symbol had never gotten a