Skip to content

Commit 1aeb111

Browse files
committed
Simplify list truthiness checks in parse_pieces
titles and suffixes are already lists; len(list(...)) just re-wraps them. Use plain truthiness instead.
1 parent 549690e commit 1aeb111

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nameparser/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,10 +1249,10 @@ def parse_pieces(self, parts: Iterable[str], additional_parts_count: int = 0) ->
12491249
suffixes = list(filter(self.is_suffix, period_chunks))
12501250

12511251
# register the part so it will be found by the is_* checks
1252-
if len(list(titles)):
1252+
if titles:
12531253
self._derived_titles.add(lc(part))
12541254
continue
1255-
if len(list(suffixes)):
1255+
if suffixes:
12561256
self._derived_suffixes.add(lc(part))
12571257
continue
12581258

0 commit comments

Comments
 (0)