Skip to content

Commit b688fb5

Browse files
authored
Merge pull request #131 from lqd/EZ-winz
easy win: use the fx hasher when interning
2 parents a05aea4 + 358b506 commit b688fb5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/intern.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use crate::facts::*;
2+
use rustc_hash::FxHashMap;
23
use std::collections::HashMap;
34

45
/// When we load facts out of the table, they are essentially random
56
/// strings. We create an intern table to map those to small integers.
67
pub(crate) struct Interner<TargetType: From<usize> + Copy> {
7-
strings: HashMap<String, TargetType>,
8+
strings: FxHashMap<String, TargetType>,
89
rev_strings: Vec<String>,
910
}
1011

@@ -14,7 +15,7 @@ where
1415
{
1516
fn new() -> Self {
1617
Self {
17-
strings: HashMap::new(),
18+
strings: HashMap::default(),
1819
rev_strings: vec![],
1920
}
2021
}

0 commit comments

Comments
 (0)