From 3365ead94da6739fb4f10093df444f7c8cef9df1 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 13 Jun 2015 20:40:28 +0200 Subject: Swap some visibility conditionals. rev_dep == "m" is relatively rare, so check it first. --- kconfiglib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index b780495..a043a80 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2054,7 +2054,7 @@ class Symbol(Item): return None rev_dep = self.config._eval_expr(self.rev_dep) # A bool selected to "m" gets promoted to "y" - if self.type == BOOL and rev_dep == "m": + if rev_dep == "m" and self.type == BOOL: rev_dep = "y" vis = _get_visibility(self) if tri_to_int[vis] > tri_to_int[rev_dep]: @@ -2077,7 +2077,7 @@ class Symbol(Item): return None rev_dep = self.config._eval_expr(self.rev_dep) # A bool selected to "m" gets promoted to "y" - if self.type == BOOL and rev_dep == "m": + if rev_dep == "m" and self.type == BOOL: rev_dep = "y" if tri_to_int[_get_visibility(self)] > tri_to_int[rev_dep]: return rev_dep @@ -2100,7 +2100,7 @@ class Symbol(Item): return [] rev_dep = self.config._eval_expr(self.rev_dep) # A bool selected to "m" gets promoted to "y" - if self.type == BOOL and rev_dep == "m": + if rev_dep == "m" and self.type == BOOL: rev_dep = "y" res = ["n", "m", "y"][tri_to_int[rev_dep] : tri_to_int[_get_visibility(self)] + 1] @@ -2256,7 +2256,7 @@ class Symbol(Item): if self.type == BOOL or self.type == TRISTATE: rev_dep = self.config._eval_expr(self.rev_dep) # A bool selected to "m" gets promoted to "y" - if self.type == BOOL and rev_dep == "m": + if rev_dep == "m" and self.type == BOOL: rev_dep = "y" return tri_to_int[_get_visibility(self)] > tri_to_int[rev_dep] return _get_visibility(self) != "n" -- cgit v1.2.3