diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-01-16 17:54:16 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-01-16 18:14:55 +0100 |
| commit | 5f18eb738a34994a8e74d65fb9fa17b31f2919bc (patch) | |
| tree | 3b9d257380228cf41dc686869aca38a2e94362c8 | |
| parent | 3264cea4ef05950d2e931f086ad7bbe232fe87cb (diff) | |
_tokenize() non-constant symbol parsing style nit
Saves a tiny bit of bytecode too.
| -rw-r--r-- | kconfiglib.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index f2236e2..960f75e 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1271,14 +1271,12 @@ class Kconfig(object): token = keyword elif token not in _STRING_LEX: - # It's a non-const symbol... - if name in ("n", "m", "y"): - # ...except we translate n, m, and y into the - # corresponding constant symbols, like the C - # implementation - token = self.const_syms[name] - else: - token = self._lookup_sym(name) + # It's a non-const symbol, except we translate n, m, and y + # into the corresponding constant symbols, like the C + # implementation + token = self.const_syms[name] \ + if name in ("n", "m", "y") else \ + self._lookup_sym(name) else: # It's a case of missing quotes. For example, the |
