Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and shrink Entry #299

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jan 24, 2024

  • Refactor Entry with more separation from the raw part
  • Add a core method to support set's replace_full
    • This lets us remove the saved key from map::OccupiedEntry. That also shrinks Entry because there's now room for the enum tag in a layout niche, although such layout is not guaranteed.

This may improve performance slightly, because it will perform a hash
lookup only once, although `RawTable` does force an early reserve to
accomplish that. This is the same trade-off that `insert` makes.

This also lets us remove the saved key from `map::OccupiedEntry`, which
may benefit all other `entry` use cases where that was unused.
@cuviper cuviper added this pull request to the merge queue Jan 24, 2024
Merged via the queue into indexmap-rs:master with commit aed1204 Jan 24, 2024
15 checks passed
@cuviper cuviper deleted the refactor-entry branch January 25, 2024 05:12
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.

1 participant