Skip to content

Commit daf8fb5

Browse files
authored
Merge pull request #10648 from oech3/shufxxh3
shuf: Use rustc-hash for performance
2 parents 2deedae + f856a46 commit daf8fb5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

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)