diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-01-19 17:38:40 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-01-19 18:36:16 +0100 |
| commit | c800f70f4b3e96f1e6e19bc3ddcf9f0353721b7b (patch) | |
| tree | 5549d7fd2b308dc5809b2c02133e6216d4f1eaec /kconfiglib.py | |
| parent | 112a6b18384a41d072feade69f5f6594a21998f8 (diff) | |
Simplify _deindent()
Old code. Can't remember why it kept lines shorter than the indent as-is
instead of clearing them, but it's pointless for help texts, which is
the only place where _deindent() is used. s[n:] is safe even if
n >= len(s).
Help text parsing is pretty hot code too, so every bit helps.
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 2998a07..424794f 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3755,10 +3755,7 @@ def _deindent(line, indent): """ Deindents 'line' by 'indent' spaces. """ - line = line.expandtabs() - if len(line) <= indent: - return line - return line[indent:] + return line.expandtabs()[indent:] def _is_base_n(s, n): try: |
