diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-03-19 21:44:56 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-03-19 21:58:54 +0100 |
| commit | 5c911d9c43f0dc264058c3ecba7d7784d624928f (patch) | |
| tree | e11942f0b5e5b3657a76ab8d5379e7a4b7ca7921 | |
| parent | da1450839fc22b10a91f8247969acd6b3af3cc9b (diff) | |
Clean up _expr_depends_on() a bit
'left' is guaranteed to be 'sym' if the preceding conditional was true.
| -rw-r--r-- | kconfiglib.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 63d31a7..716afcc 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -4429,19 +4429,16 @@ def _expr_depends_on(expr, sym): if right is sym: left, right = right, left - - if left is not sym: + elif left is not sym: return False return (expr[0] == EQUAL and right is sym.kconfig.m or \ right is sym.kconfig.y) or \ (expr[0] == UNEQUAL and right is sym.kconfig.n) - if expr[0] == AND: - return _expr_depends_on(expr[1], sym) or \ - _expr_depends_on(expr[2], sym) - - return False + return expr[0] == AND and \ + (_expr_depends_on(expr[1], sym) or + _expr_depends_on(expr[2], sym)) def _auto_menu_dep(node1, node2): # Returns True if node2 has an "automatic menu dependency" on node1. If |
