From e3299bbb0bbac402a658a15710b816b65657102a Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 16 Jun 2015 18:01:07 +0200 Subject: Simplify next_nonblank() a bit. --- kconfiglib.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 8379182..0afb7b6 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3144,13 +3144,12 @@ class _FileFeed(object): self.linenr -= 1 def next_nonblank(self): - """Removes lines up to and including the next non-blank - (not all-space) line and returns it.""" + """Removes lines up to and including the next non-blank (not all-space) + line and returns it. Returns None if there are no more non-blank + lines.""" while 1: line = self.get_next() - if line is None: - return None - if not line.isspace(): + if line is None or not line.isspace(): return line def get_filename(self): -- cgit v1.2.3