Skip to content

Use IdentityHashMaps instead of HashMaps where keys are mutated after insertion#1593

Merged
antvaset merged 3 commits intomasterfrom
use-identity-hash-maps-for-maps-with-mutable-keys
Aug 7, 2025
Merged

Use IdentityHashMaps instead of HashMaps where keys are mutated after insertion#1593
antvaset merged 3 commits intomasterfrom
use-identity-hash-maps-for-maps-with-mutable-keys

Conversation

@antvaset
Copy link
Copy Markdown
Contributor

The keys in the entries added to the functionHeadersByDef and functionDefinitions HashMaps are mutated as the visitor goes on. This breaks subsequent lookups based on hashCodes.

IdentityHashMaps can be used instead to map and look up by reference.

@github-actions
Copy link
Copy Markdown

Formatting check succeeded!

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.07%. Comparing base (dc42e55) to head (897a545).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1593      +/-   ##
============================================
- Coverage     65.08%   65.07%   -0.01%     
+ Complexity     1977     1976       -1     
============================================
  Files           499      499              
  Lines         28832    28828       -4     
  Branches       5672     5671       -1     
============================================
- Hits          18765    18761       -4     
- Misses         7742     7743       +1     
+ Partials       2325     2324       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

@antvaset antvaset enabled auto-merge (squash) August 1, 2025 11:08
@antvaset antvaset merged commit 9ad86f0 into master Aug 7, 2025
7 checks passed
@antvaset antvaset deleted the use-identity-hash-maps-for-maps-with-mutable-keys branch August 7, 2025 20:08
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.

3 participants