diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-17 19:23:56 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-17 19:23:56 +0100 |
| commit | 4d6c81123d5050b577ab22e550fee2b39fb23f46 (patch) | |
| tree | f9be9d4990184034b165fd50078c62927ced967a /kconfiglib.py | |
| parent | 19be9c57a69bf9a2e62056e6c73ee2a569c86a9d (diff) | |
Small simplification.
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 97c0450..2b65ee1 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -699,16 +699,8 @@ class Config(): quote = c i += 1 - # Fast path: If the rest of the string contains no backslashes - # (almost always), we can simply look for the matching quote. - if s.find("\\", i) == -1: - end = s.find(quote, i) - if end == -1: - _tokenization_error(s, strlen, filename, linenr) - append(s[i:end]) - i = end + 1 - else: - # Slow path. This could probably be sped up, but it's a + if "\\" in s: + # Slow path: This could probably be sped up, but it's a # very unusual case anyway. value = "" while 1: @@ -727,6 +719,14 @@ class Config(): i += 1 i += 1 append(value) + else: + # Fast path: If the rest of the string contains no backslashes + # (almost always) we can simply look for the matching quote. + end = s.find(quote, i) + if end == -1: + _tokenization_error(s, strlen, filename, linenr) + append(s[i:end]) + i = end + 1 elif c == "&": if i + 1 >= strlen: |
