From ed4909670d428f89dca972bfc29b7708d22878f0 Mon Sep 17 00:00:00 2001 From: Acrimon Date: Sun, 11 Aug 2019 22:10:36 +0200 Subject: [PATCH] Use hashbrown instead of fxhashmap in world. --- Cargo.lock | 2 +- world/Cargo.toml | 2 +- world/src/sim/location.rs | 6 +++--- world/src/util/hash_cache.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd8ef47a04..5927cc1237 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3007,7 +3007,7 @@ dependencies = [ name = "veloren-world" version = "0.3.0" dependencies = [ - "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "minifb 0.12.0 (git+https://github.com/emoon/rust_minifb.git)", "noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/world/Cargo.toml b/world/Cargo.toml index f31d0f1e43..7d2bef9fc4 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" common = { package = "veloren-common", path = "../common" } vek = "0.9.8" noise = "0.5.1" -fxhash = "0.2.1" +hashbrown = "0.5.0" lazy_static = "1.3.0" rand = "0.7.0" rand_chacha = "0.2.1" diff --git a/world/src/sim/location.rs b/world/src/sim/location.rs index 93ac61b62c..2e548ef429 100644 --- a/world/src/sim/location.rs +++ b/world/src/sim/location.rs @@ -1,5 +1,5 @@ use super::Settlement; -use fxhash::FxHashSet; +use hashbrown::HashSet; use rand::seq::SliceRandom; use rand::Rng; use vek::*; @@ -9,7 +9,7 @@ pub struct Location { pub(crate) name: String, pub(crate) center: Vec2, pub(crate) kingdom: Option, - pub(crate) neighbours: FxHashSet, + pub(crate) neighbours: HashSet, pub(crate) settlement: Settlement, } @@ -19,7 +19,7 @@ impl Location { name: generate_name(rng), center, kingdom: None, - neighbours: FxHashSet::default(), + neighbours: HashSet::default(), settlement: Settlement::generate(rng), } } diff --git a/world/src/util/hash_cache.rs b/world/src/util/hash_cache.rs index a797d6c146..2abe5c8cd7 100644 --- a/world/src/util/hash_cache.rs +++ b/world/src/util/hash_cache.rs @@ -1,9 +1,9 @@ -use fxhash::FxHashMap; +use hashbrown::HashMap; use std::hash::Hash; pub struct HashCache { capacity: usize, - map: FxHashMap, + map: HashMap, counter: usize, } @@ -17,7 +17,7 @@ impl HashCache { pub fn with_capacity(capacity: usize) -> Self { Self { capacity, - map: FxHashMap::default(), + map: HashMap::default(), counter: 0, } }