Skip to content

Commit

Permalink
Update changelog and revise comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Dec 12, 2024
1 parent 2d147f5 commit 4ecc149
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# 2.14 (2024-12-08)
# next (unreleased)

* Handle `while True` loops without `break` statements (kreathon).

# 2.14 (2024-12-08)

* Improve reachability analysis (kreathon, #270, #302).
* Add type hints for `get_unused_code` and the fields of the `Item` class (John Doknjas, #361).

Expand Down
4 changes: 2 additions & 2 deletions vulture/reachability.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def __init__(self, report):

# Since we visit the children nodes first, we need to maintain a flag
# that indicates if a break statement was seen. When visiting the
# parent (While, For, or AsyncFor), the value is checked and reset.
# Assumes code is valid (break statements only in loops).
# parent (While, For or AsyncFor), the value is checked (for While)
# and reset. Assumes code is valid (break statements only in loops).
self._current_loop_has_break_statement = False

def visit(self, node):
Expand Down

0 comments on commit 4ecc149

Please sign in to comment.