Skip to content

fix(collections): visit wrapped collision entries once in retain - #4225

Draft
bobzhang wants to merge 1 commit into
mainfrom
codex/core-audit-retain
Draft

bobzhang wants to merge 1 commit into
mainfrom
codex/core-audit-retain

Conversation

@bobzhang

Copy link
Copy Markdown
Contributor

When a collision chain wraps around the end of the backing table, HashMap::retain and HashSet::retain can call the predicate more than once for an entry moved by deletion.

Start scanning at an empty slot so each wrapped chain is visited together. Add regressions that count visits and check that retained keys remain accessible; document the once-per-entry predicate contract.

Validation:

  • moon check --deny-warn
  • moon test hashmap hashset --target all
  • moon info; generated interfaces unchanged

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 6623

Coverage increased (+0.004%) to 89.318%

Details

  • Coverage increased (+0.004%) from the base build.
  • Patch coverage: 8 of 8 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 18414
Covered Lines: 16447
Line Coverage: 89.32%
Coverage Strength: 272788.8 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants