Skip to content

Commit

Permalink
refactor: test the easier conditions first
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Dec 2, 2023
1 parent 6530a14 commit 2a447e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions coverage/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ def _raw_parse(self) -> None:
for l in range(first_line, elineno+1): # type: ignore[unreachable]
self._multiline[l] = first_line
# Check if multi-line was before a suite (trigger by the colon token).
statement_multilines = set(range(first_line, elineno + 1))
if (statement_multilines & set(self.raw_excluded) and prev_toktype == token.OP
and prev_ttext == ":" and nesting == 0):
exclude_indent = indent
excluding = True
if nesting == 0 and prev_toktype == token.OP and prev_ttext == ":":
statement_multilines = set(range(first_line, elineno + 1))
if statement_multilines & set(self.raw_excluded):
exclude_indent = indent
excluding = True
first_line = None
first_on_line = True

Expand Down

0 comments on commit 2a447e8

Please sign in to comment.