Skip to content

Use retain in ItemMap::filter#932

Merged
emilio merged 1 commit intomozilla:masterfrom
cuviper:map-retain
Apr 14, 2024
Merged

Use retain in ItemMap::filter#932
emilio merged 1 commit intomozilla:masterfrom
cuviper:map-retain

Conversation

@cuviper
Copy link
Copy Markdown
Contributor

@cuviper cuviper commented Mar 14, 2024

This mutation can be done in-place with retain on both the IndexMap and its inner Cfg(Vec) values. In addition to being simpler, it should be a little faster since it doesn't need new allocations nor re-hashing of retained items.

@emilio emilio merged commit bde8ab4 into mozilla:master Apr 14, 2024
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