summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-09-20 07:58:20 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2017-09-20 08:10:16 +0200
commit9f404313e8d81344157494d33e0897cf9e5e1ca5 (patch)
tree5b9cc3862f36e0bd93897038b69f61e175390f55 /kconfiglib.py
parentc8df7316d1ed151b93566a61ed9d95da67e17974 (diff)
Use tri_greater() where applicable
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 12da848..11b462d 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2157,9 +2157,7 @@ class Symbol(Item):
if rev_dep == "m" and self.type == BOOL:
return None
vis = _get_visibility(self)
- if TRI_TO_INT[vis] > TRI_TO_INT[rev_dep]:
- return vis
- return None
+ return vis if tri_greater(vis, rev_dep) else None
def get_lower_bound(self):
"""For string/hex/int symbols and for bool and tristate symbols that
@@ -2179,9 +2177,7 @@ class Symbol(Item):
# A bool selected to "m" gets promoted to "y", pinning it
if rev_dep == "m" and self.type == BOOL:
return None
- if TRI_TO_INT[_get_visibility(self)] > TRI_TO_INT[rev_dep]:
- return rev_dep
- return None
+ return rev_dep if tri_greater(_get_visibility(self), rev_dep) else None
def get_assignable_values(self):
"""For string/hex/int symbols and for bool and tristate symbols that
@@ -2340,7 +2336,7 @@ class Symbol(Item):
# A bool selected to "m" gets promoted to "y", pinning it
if rev_dep == "m" and self.type == BOOL:
return False
- return TRI_TO_INT[_get_visibility(self)] > TRI_TO_INT[rev_dep]
+ return tri_greater(_get_visibility(self), rev_dep)
return _get_visibility(self) != "n"
def is_defined(self):