mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 02:08:09 +00:00
Merge pull request #1044 from Shnatsel/fnv-hash-map
tr: use FnvHashMap instead of default HashMap backed by SipHasher
This commit is contained in:
commit
ee9013215b
2 changed files with 4 additions and 3 deletions
|
@ -10,6 +10,7 @@ path = "tr.rs"
|
|||
[dependencies]
|
||||
getopts = "*"
|
||||
bit-set = "*"
|
||||
fnv = "*"
|
||||
|
||||
[dependencies.uucore]
|
||||
path = "../uucore"
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
extern crate bit_set;
|
||||
extern crate getopts;
|
||||
extern crate fnv;
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
@ -21,7 +22,7 @@ extern crate uucore;
|
|||
use bit_set::BitSet;
|
||||
use getopts::Options;
|
||||
use std::io::{stdin, stdout, BufRead, BufWriter, Write};
|
||||
use std::collections::HashMap;
|
||||
use fnv::FnvHashMap;
|
||||
|
||||
use expand::ExpandSet;
|
||||
|
||||
|
@ -65,8 +66,7 @@ fn delete(set: ExpandSet, complement: bool) {
|
|||
}
|
||||
|
||||
fn tr<'a>(set1: ExpandSet<'a>, mut set2: ExpandSet<'a>) {
|
||||
//let mut map = VecMap::new();
|
||||
let mut map = HashMap::new();
|
||||
let mut map = FnvHashMap::default();
|
||||
let stdin = stdin();
|
||||
let mut locked_stdin = stdin.lock();
|
||||
let mut buffered_stdout = BufWriter::new(stdout());
|
||||
|
|
Loading…
Reference in a new issue