summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-10-30 22:56:43 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-10-30 23:02:13 +0100
commit81272be3cefa0c14de753542e3334841f09bc4a0 (patch)
treee2aecf04ecfe2245ad4cb87b6dd1d84fe65e2c24
parentc679105fd9d26b2266ed7f46b652ae27e9539bbc (diff)
Remove no longer needed 'node.item is None' tests
After commit e0256b6 ("Have MENU and COMMENT match _T_MENU and _T_COMMENT"), the only falsy value for node.item is None, since all token constants are truthy (since they're never 0).
-rw-r--r--kconfiglib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index ff33f30..dc2c96d 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -5133,7 +5133,7 @@ class MenuNode(object):
elif self.item is COMMENT:
fields.append("menu node for comment")
- elif self.item is None:
+ elif not self.item:
fields.append("menu node for if (should not appear in the final "
" tree)")
@@ -5781,12 +5781,12 @@ def _remove_ifs(node):
# makes it nicer to work with.
first = node.list
- while first and first.item is None:
+ while first and not first.item:
first = first.next
cur = first
while cur:
- if cur.next and cur.next.item is None:
+ if cur.next and not cur.next.item:
cur.next = cur.next.next
cur = cur.next