Skip to content

Commit

Permalink
Use hashbrown for FlecsIdMap (#206)
Browse files Browse the repository at this point in the history
This removes a dependency on `fxhash` and uses `hashbrown` which
now defaults to `foldhash`.

`fxhash` hasn't been updated / maintained in 7 years and the
Rust community has largely moved on to other hash algorithms
over time.

(This is also more friendly for future potential `no_std` support.)
  • Loading branch information
waywardmonkeys authored Nov 11, 2024
1 parent 289e478 commit 9711fe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flecs_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ flecs_ecs_derive = { workspace = true }
flecs_ecs_sys = { workspace = true }
bitflags = "2.6.0"
compact_str = "0.8.0"
fxhash = "0.2.1"
hashbrown = "0.15.0"

# used for backtraces upon hardware exceptions during test
# only used when "test-with-crash-handler" feature enabled
Expand Down
2 changes: 1 addition & 1 deletion flecs_ecs/src/core/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Clone for World {
}
}

pub(crate) type FlecsIdMap = std::collections::HashMap<TypeId, u64, fxhash::FxBuildHasher>;
pub(crate) type FlecsIdMap = hashbrown::HashMap<TypeId, u64>;

unsafe impl Send for World {}

Expand Down

0 comments on commit 9711fe6

Please sign in to comment.