From 1a442963b281e2cb80c852c4074061bfcddfb448 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 13 Jun 2015 20:22:03 +0200 Subject: Simplify visibility functions. Not sure why I used that form the first time around. --- kconfiglib.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index c07f3b9..b780495 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2057,7 +2057,7 @@ class Symbol(Item): if self.type == BOOL and rev_dep == "m": rev_dep = "y" vis = _get_visibility(self) - if (tri_to_int[vis] - tri_to_int[rev_dep]) > 0: + if tri_to_int[vis] > tri_to_int[rev_dep]: return vis return None @@ -2079,7 +2079,7 @@ class Symbol(Item): # A bool selected to "m" gets promoted to "y" if self.type == BOOL and rev_dep == "m": rev_dep = "y" - if (tri_to_int[_get_visibility(self)] - tri_to_int[rev_dep]) > 0: + if tri_to_int[_get_visibility(self)] > tri_to_int[rev_dep]: return rev_dep return None @@ -2258,8 +2258,7 @@ class Symbol(Item): # A bool selected to "m" gets promoted to "y" if self.type == BOOL and rev_dep == "m": rev_dep = "y" - return (tri_to_int[_get_visibility(self)] - - tri_to_int[rev_dep]) > 0 + return tri_to_int[_get_visibility(self)] > tri_to_int[rev_dep] return _get_visibility(self) != "n" def is_defined(self): -- cgit v1.2.3