Skip to content

Commit 42a2436

Browse files
committed
Switch to hashbrown's RawTable internally
1 parent 43b5fac commit 42a2436

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
@@ -53,9 +53,10 @@
5353
//! [def]: map/struct.IndexMap.html#impl-Default
5454
5555
#[cfg(not(has_std))]
56-
#[macro_use(vec)]
5756
extern crate alloc;
5857

58+
extern crate hashbrown;
59+
5960
#[cfg(not(has_std))]
6061
pub(crate) mod std {
6162
pub use core::*;
@@ -102,8 +103,8 @@ struct HashValue(usize);
102103

103104
impl HashValue {
104105
#[inline(always)]
105-
fn get(self) -> usize {
106-
self.0
106+
fn get(self) -> u64 {
107+
self.0 as u64
107108
}
108109
}
109110

0 commit comments

Comments
 (0)