From 36971bb127f3505a47cdf3d1f2e965ec12266247 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 19 May 2018 01:34:24 +0200 Subject: Micro-optimize help text parsing some more This code is surprisingly hot. --- kconfiglib.py | 5 +++-- 1 file 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). -- cgit v1.2.3