Skip to content

Commit 39ab755

Browse files
committed
chore: drop stale comment from _async_evict_oldest fall-through
The comment said drift would surface via ``test_cache_total_records_invariant_under_mixed_ops``, but that test only exercises well-formed paths and never produces a heap-empty-with-counter-nonzero state. The test that actually pins the broken-invariant recovery is ``test_cache_eviction_empty_heap_returns_without_evicting``. Per ``CLAUDE.md`` ("default to no comments"; cross-references rot when referents are renamed) the comment shouldn't exist at all — the function name and docstring already describe the contract, and the while-loop fall-through is self-explanatory.
1 parent e5b509a commit 39ab755

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

src/zeroconf/_cache.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ def _async_evict_oldest(self) -> None:
135135
continue
136136
self._async_remove(record)
137137
return
138-
# Heap-empty fall-through is unreachable by the cache invariant
139-
# (every counted record has a heap entry); accounting drift would
140-
# surface in tests via test_cache_total_records_invariant_under_mixed_ops.
141138

142139
def _maybe_rebuild_heap(self) -> None:
143140
"""Rebuild ``_expire_heap`` when stale entries dominate live ones."""

0 commit comments

Comments
 (0)