summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index eae271e..96e6b52 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -5822,17 +5822,17 @@ def _remove_ifs(node):
node.list = cur
while cur:
- if cur.next and not cur.next.item:
- # Equivalent to
- #
- # tmp = cur.next.next
- # cur.next = tmp
- # cur = tmp
- #
- # due to tricky Python semantics. The order matters.
- cur.next = cur = cur.next.next
- else:
- cur = cur.next
+ next = cur.next
+ while next and not next.item:
+ next = next.next
+
+ # Equivalent to
+ #
+ # cur.next = next
+ # cur = next
+ #
+ # due to tricky Python semantics. The order matters.
+ cur.next = cur = next
def _finalize_choice(node):
# Finalizes a choice, marking each symbol whose menu node has the choice as