From 81272be3cefa0c14de753542e3334841f09bc4a0 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 30 Oct 2018 22:56:43 +0100 Subject: 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). --- kconfiglib.py | 6 +++--- 1 file 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 -- cgit v1.2.3