From 98f0b05dbf591d3b912e4d69d6717d4e48192746 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 6 Jun 2015 00:54:43 +0200 Subject: Remove _Feed.is_empty(). Redundant. --- kconfiglib.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index da5779f..b84f8bc 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -948,10 +948,9 @@ class Config(object): tokens = self._tokenize(line, False, filename, linenr) - if tokens.is_empty(): - continue - t0 = tokens.get_next() + if t0 is None: + continue # Cases are ordered roughly by frequency, which speeds things up a # bit @@ -1146,10 +1145,9 @@ class Config(object): tokens = self._tokenize(line, False, filename, linenr) - if tokens.is_empty(): - continue - t0 = tokens.get_next() + if t0 is None: + continue # Cases are ordered roughly by frequency, which speeds things up a # bit @@ -3537,9 +3535,6 @@ class _Feed(object): def __len__(self): return len(self.items) - def is_empty(self): - return self.items == [] - def check(self, token): """Check if the next token is 'token'. If so, remove it from the token feed and return True. Otherwise, leave it in and return False.""" -- cgit v1.2.3