From 277c43348b65d8f6a4fb16c66fd48e9c697661e9 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 23 Jun 2019 14:40:17 +0200 Subject: Factor out multiplication in expr_value() --- kconfiglib.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index e88fc1a..acf365c 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -5831,12 +5831,12 @@ def expr_value(expr): # parse as numbers comp = _strcmp(v1.str_value, v2.str_value) - if rel is EQUAL: return 2*(comp == 0) - if rel is UNEQUAL: return 2*(comp != 0) - if rel is LESS: return 2*(comp < 0) - if rel is LESS_EQUAL: return 2*(comp <= 0) - if rel is GREATER: return 2*(comp > 0) - return 2*(comp >= 0) # rel is GREATER_EQUAL + return 2*(comp == 0 if rel is EQUAL else + comp != 0 if rel is UNEQUAL else + comp < 0 if rel is LESS else + comp <= 0 if rel is LESS_EQUAL else + comp > 0 if rel is GREATER else + comp >= 0) def standard_sc_expr_str(sc): -- cgit v1.2.3