Skip to content

Commit

Permalink
Merge pull request #131 from lqd/EZ-winz
Browse files Browse the repository at this point in the history
easy win: use the fx hasher when interning
  • Loading branch information
nikomatsakis authored Oct 3, 2019
2 parents a05aea4 + 358b506 commit b688fb5
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 b688fb5

Please sign in to comment.