Skip to content

Commit

Permalink
Update hashbrown
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Oct 13, 2024
1 parent 1ffdca9 commit ad9a149
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ row-serialize = ["serde"]

[dependencies]
hecs-macros = { path = "macros", version = "0.10.0", optional = true }
hashbrown = { version = "0.14", default-features = false, features = ["ahash", "inline-more"] }
hashbrown = { version = "0.15", default-features = false, features = ["default-hasher", "inline-more"] }
serde = { version = "1.0.117", default-features = false, optional = true }
spin = { version = "0.9.8", default-features = false, features = ["mutex", "spin_mutex", "lazy"] }
foldhash = { version = "0.1.3", default-features = false }

[dev-dependencies]
bencher = "0.1.5"
Expand Down
4 changes: 2 additions & 2 deletions src/archetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use core::hash::{BuildHasher, BuildHasherDefault, Hasher};
use core::ops::{Deref, DerefMut};
use core::ptr::{self, NonNull};

use hashbrown::{hash_map::DefaultHashBuilder, HashMap};
use hashbrown::HashMap;

use crate::borrow::AtomicBorrow;
use crate::query::Fetch;
Expand Down Expand Up @@ -476,7 +476,7 @@ impl Hasher for TypeIdHasher {

// This will only be called if TypeId is neither u64 nor u128, which is not anticipated.
// In that case we'll just fall back to using a different hash implementation.
let mut hasher = <DefaultHashBuilder as BuildHasher>::Hasher::default();
let mut hasher = foldhash::fast::FixedState::with_seed(0xb334867b740a29a5).build_hasher();
hasher.write(bytes);
self.hash = hasher.finish();
}
Expand Down

0 comments on commit ad9a149

Please sign in to comment.