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

Updates following hashbrown's inclusion in std #127

Merged
merged 4 commits into from
May 28, 2019
Merged

Conversation

jonhoo
Copy link
Owner

@jonhoo jonhoo commented May 28, 2019

hashbrown no longer needs to be included as a dependency. It also has a different ordering than the old HashMap, which caused our nameattr tests to start failing. Instead of relying on the new order (which would make tests fail on stable), I changed the implementation to use an IndexMap (which preserves insertion order) so that we aren't dependent on the map order any more. This is probably also more reasonable, since it means that the attribute order from the nameattr file will be preserved.

This PR also switches most maps to use FNV hashing, since we don't really need the adverserial robustness that randomized hashing gives us in this context.

Hashbrown has a different ordering from HashMap, even with deterministic
fnv hashing, so the tests were failing on beta. This changes nameattr to
use an indexmap instead, which has a reliable ordering at all times
(insertion order). This is probably a better behavior anyway, because it
means that attributes will be added in the order they appear in the
nameattr file.
Copy link
Collaborator

@jasonrhansen jasonrhansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

src/differential/mod.rs Outdated Show resolved Hide resolved
@jonhoo jonhoo merged commit 8302c90 into master May 28, 2019
@jonhoo jonhoo deleted the hashbrown-in-std branch July 24, 2019 14:52
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