Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2018"

[dependencies]
# For the default hasher
ahash = { version = "0.6.1", default-features = false, optional = true }
ahash = { version = "0.7.0", default-features = false, optional = true }

# For external trait impls
rayon = { version = "1.0", optional = true }
Expand Down
36 changes: 8 additions & 28 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,10 @@ where
Q: Hash + ?Sized,
S: BuildHasher,
{
#[cfg(feature = "ahash")]
{
//This enables specialization to improve performance on primitive types
use ahash::CallHasher;
let state = hash_builder.build_hasher();
Q::get_hash(val, state)
}
#[cfg(not(feature = "ahash"))]
{
use core::hash::Hasher;
let mut state = hash_builder.build_hasher();
val.hash(&mut state);
state.finish()
}
use core::hash::Hasher;
let mut state = hash_builder.build_hasher();
val.hash(&mut state);
state.finish()
}

#[cfg_attr(feature = "inline-more", inline)]
Expand All @@ -273,20 +263,10 @@ where
K: Hash,
S: BuildHasher,
{
#[cfg(feature = "ahash")]
{
//This enables specialization to improve performance on primitive types
use ahash::CallHasher;
let state = hash_builder.build_hasher();
K::get_hash(val, state)
}
#[cfg(not(feature = "ahash"))]
{
use core::hash::Hasher;
let mut state = hash_builder.build_hasher();
val.hash(&mut state);
state.finish()
}
use core::hash::Hasher;
let mut state = hash_builder.build_hasher();
val.hash(&mut state);
state.finish()
}

#[cfg(feature = "ahash")]
Expand Down