From 5f18eb738a34994a8e74d65fb9fa17b31f2919bc Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 16 Jan 2018 17:54:16 +0100 Subject: _tokenize() non-constant symbol parsing style nit Saves a tiny bit of bytecode too. --- kconfiglib.py | 14 ++++++-------- 1 file 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 -- cgit v1.2.3