Skip to content

Commit

Permalink
Use the fx hasher when interning
Browse files Browse the repository at this point in the history
  • Loading branch information
lqd committed Sep 26, 2019
1 parent a05aea4 commit 358b506
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/intern.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::facts::*;
use rustc_hash::FxHashMap;
use std::collections::HashMap;

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

Expand All @@ -14,7 +15,7 @@ where
{
fn new() -> Self {
Self {
strings: HashMap::new(),
strings: HashMap::default(),
rev_strings: vec![],
}
}
Expand Down

0 comments on commit 358b506

Please sign in to comment.