summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-05-19 01:34:24 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-05-19 01:34:24 +0200
commit36971bb127f3505a47cdf3d1f2e965ec12266247 (patch)
tree14f459a61a7bdb76b8b141b43ee12af87d148210 /kconfiglib.py
parent754ca0f865c2484ff6bf14d9db1c321c0a677273 (diff)
Micro-optimize help text parsing some more
This code is surprisingly hot.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 7e90c26..b73ea10 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2301,10 +2301,11 @@ class Kconfig(object):
# than the first line
help_lines = []
- # Small optimization
+ # Small optimizations
add_help_line = help_lines.append
+ indentation = _indentation
- while line and (line.isspace() or _indentation(line) >= indent):
+ while line and (line.isspace() or indentation(line) >= indent):
# De-indent 'line' by 'indent' spaces and rstrip() it to remove any
# newlines (which gets rid of other trailing whitespace too, but
# that's fine).