diff --git a/starlark_map/Cargo.toml b/starlark_map/Cargo.toml index 0faab2642..19903c2fa 100644 --- a/starlark_map/Cargo.toml +++ b/starlark_map/Cargo.toml @@ -15,7 +15,7 @@ allocative = { workspace = true, features = ["hashbrown"] } dupe = { workspace = true } equivalent = { workspace = true } -fnv = "1.0.7" +fxhash = "0.2.1" hashbrown = { version = "0.12.3", features = ["raw"] } serde = { version = "1.0", features = ["derive"] } diff --git a/starlark_map/src/hasher.rs b/starlark_map/src/hasher.rs index a85422637..0443c6599 100644 --- a/starlark_map/src/hasher.rs +++ b/starlark_map/src/hasher.rs @@ -19,7 +19,7 @@ use std::hash::BuildHasher; use std::hash::Hasher; use dupe::Dupe; -use fnv::FnvHasher; +use fxhash::FxHasher64; use crate::hash_value::StarlarkHashValue; @@ -27,7 +27,10 @@ use crate::hash_value::StarlarkHashValue; /// /// Starlark relies on stable hashing, and this is the hasher. #[derive(Default)] -pub struct StarlarkHasher(FnvHasher); +pub struct StarlarkHasher( + // TODO(nga): `FxHasher64` is endian-dependent, this is not right. + FxHasher64, +); impl StarlarkHasher { /// Creates a new hasher.