summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2015-06-10 23:35:51 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2015-06-10 23:44:40 +0200
commit41158044eb9d7abdd2ba7a1d127bb26e34ef1630 (patch)
treea11f12d08a087d0282dce1e93a4716e7e8fb8d54
parent799c2e630948144ccc58be0be1ca5c1c3369fc09 (diff)
Put the most common case first in _make_and().
Measured with line_profiler on the x86 Kconfigs.
-rw-r--r--kconfiglib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 281cded..522b99d 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -3189,12 +3189,12 @@ def _make_and(e1, e2):
Nones equate to 'y'.
Note: returns None if e1 == e2 == None."""
- if e1 == "n" or e2 == "n":
- return "n"
if e1 is None or e1 == "y":
return e2
if e2 is None or e2 == "y":
return e1
+ if e1 == "n" or e2 == "n":
+ return "n"
# Prefer to merge/update argument list if possible instead of creating
# a new AND node