Skip to content

Commit f856a46

Browse files
committed
shuf: Use rustc-hash for performance
1 parent 61da637 commit f856a46

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/shuf/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rand_core = { workspace = true }
2626
sha3 = { workspace = true }
2727
uucore = { workspace = true }
2828
fluent = { workspace = true }
29+
rustc-hash = "2.1.1"
2930

3031
[[bin]]
3132
name = "shuf"

src/uu/shuf/src/nonrepeating_iterator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use std::collections::HashMap;
1+
// hijack HashMap for performance
2+
type HashMap<K, V> = std::collections::HashMap<K, V, rustc_hash::FxBuildHasher>;
3+
24
use std::ops::RangeInclusive;
35

46
use uucore::error::UResult;

0 commit comments

Comments
 (0)