diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-14 10:00:53 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-14 10:29:24 +0200 |
| commit | b7be018fba77db3a9ff11faf980c600d4bbb2fa8 (patch) | |
| tree | e80291ed75f5571094b79de6bda075ec5e8407f6 | |
| parent | 43480de6b2e50dc424232e9b9c97b19502f3e354 (diff) | |
Use += instead of extend()
+= also does an in-place modification for lists, and it's a bit faster.
Also get rid of an 'if node.defaults' tests. Both symbols and choices
can have defaults, and it's not worthwhile as an optimization either.
| -rw-r--r-- | kconfiglib.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 0732d14..ce2891f 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2927,14 +2927,15 @@ class Kconfig(object): # See the Symbol class docstring sc.direct_dep = self._make_or(sc.direct_dep, node.dep) - if node.defaults: - sc.defaults.extend(node.defaults) + sc.defaults += node.defaults + + # The properties below aren't available on choices if node.ranges: - sc.ranges.extend(node.ranges) + sc.ranges += node.ranges if node.selects: - sc.selects.extend(node.selects) + sc.selects += node.selects # Modify the reverse dependencies of the selected symbol for target, cond in node.selects: @@ -2943,7 +2944,7 @@ class Kconfig(object): self._make_and(sc, cond)) if node.implies: - sc.implies.extend(node.implies) + sc.implies += node.implies # Modify the weak reverse dependencies of the implied # symbol |
