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]
|
[dependencies]
|
||||||
getopts = "*"
|
getopts = "*"
|
||||||
bit-set = "*"
|
bit-set = "*"
|
||||||
|
fnv = "*"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
extern crate bit_set;
|
extern crate bit_set;
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
|
extern crate fnv;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
@ -21,7 +22,7 @@ extern crate uucore;
|
||||||
use bit_set::BitSet;
|
use bit_set::BitSet;
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use std::io::{stdin, stdout, BufRead, BufWriter, Write};
|
use std::io::{stdin, stdout, BufRead, BufWriter, Write};
|
||||||
use std::collections::HashMap;
|
use fnv::FnvHashMap;
|
||||||
|
|
||||||
use expand::ExpandSet;
|
use expand::ExpandSet;
|
||||||
|
|
||||||
|
@ -65,8 +66,7 @@ fn delete(set: ExpandSet, complement: bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tr<'a>(set1: ExpandSet<'a>, mut set2: ExpandSet<'a>) {
|
fn tr<'a>(set1: ExpandSet<'a>, mut set2: ExpandSet<'a>) {
|
||||||
//let mut map = VecMap::new();
|
let mut map = FnvHashMap::default();
|
||||||
let mut map = HashMap::new();
|
|
||||||
let stdin = stdin();
|
let stdin = stdin();
|
||||||
let mut locked_stdin = stdin.lock();
|
let mut locked_stdin = stdin.lock();
|
||||||
let mut buffered_stdout = BufWriter::new(stdout());
|
let mut buffered_stdout = BufWriter::new(stdout());
|
||||||
|
|
Loading…
Reference in a new issue