Skip to content

Commit 3f955e4

Browse files
committed
Switch to hashbrown's RawTable internally
1 parent 8973b0f commit 3f955e4

File tree

7 files changed

+439
-951
lines changed

7 files changed

+439
-951
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ autocfg = "1"
3535
serde = { version = "1.0", optional = true, default-features = false }
3636
rayon = { version = "1.0", optional = true }
3737

38+
[dependencies.hashbrown]
39+
version = "0.7"
40+
default-features = false
41+
features = ["inline-more", "raw"]
42+
3843
[dev-dependencies]
3944
itertools = "0.8"
4045
rand = {version = "0.7", features = ["small_rng"] }

README.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ indexmap
1515
.. |rustc| image:: https://img.shields.io/badge/rust-1.18%2B-orange.svg
1616
.. _rustc: https://img.shields.io/badge/rust-1.18%2B-orange.svg
1717

18-
A safe, pure-Rust hash table which preserves (in a limited sense) insertion
19-
order.
18+
A pure-Rust hash table which preserves (in a limited sense) insertion order.
2019

2120
This crate implements compact map and set data-structures,
2221
where the iteration order of the keys is independent from their hash or
@@ -45,11 +44,6 @@ was indexmap, a hash table that has following properties:
4544
- It's the usual backwards shift deletion, but only on the index vector, so
4645
it's cheaper because it's moving less memory around.
4746

48-
Does not implement (Yet)
49-
------------------------
50-
51-
- ``.reserve()`` exists but does not have a complete implementation
52-
5347
Performance
5448
-----------
5549

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@
8080
//! [def]: map/struct.IndexMap.html#impl-Default
8181
8282
#[cfg(not(has_std))]
83-
#[macro_use(vec)]
8483
extern crate alloc;
8584

85+
extern crate hashbrown;
86+
8687
#[cfg(not(has_std))]
8788
pub(crate) mod std {
8889
pub use core::*;
@@ -129,8 +130,8 @@ struct HashValue(usize);
129130

130131
impl HashValue {
131132
#[inline(always)]
132-
fn get(self) -> usize {
133-
self.0
133+
fn get(self) -> u64 {
134+
self.0 as u64
134135
}
135136
}
136137

0 commit comments

Comments
 (0)