Skip to content

Commit e78550b

Browse files
committed
Switch to FnvHashMap
1 parent a6d9930 commit e78550b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/middle/traits/select.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ use middle::infer;
3939
use middle::infer::{InferCtxt, TypeFreshener};
4040
use middle::ty_fold::TypeFoldable;
4141
use std::cell::RefCell;
42-
use std::collections::hash_map::HashMap;
4342
use std::rc::Rc;
4443
use syntax::{abi, ast};
4544
use util::common::ErrorReported;
45+
use util::nodemap::FnvHashMap;
4646
use util::ppaux::Repr;
4747

4848
pub struct SelectionContext<'cx, 'tcx:'cx> {
@@ -86,8 +86,8 @@ struct TraitObligationStack<'prev, 'tcx: 'prev> {
8686

8787
#[derive(Clone)]
8888
pub struct SelectionCache<'tcx> {
89-
hashmap: RefCell<HashMap<Rc<ty::TraitRef<'tcx>>,
90-
SelectionResult<'tcx, SelectionCandidate<'tcx>>>>,
89+
hashmap: RefCell<FnvHashMap<Rc<ty::TraitRef<'tcx>>,
90+
SelectionResult<'tcx, SelectionCandidate<'tcx>>>>,
9191
}
9292

9393
pub enum MethodMatchResult {
@@ -2634,7 +2634,7 @@ impl<'tcx> Repr<'tcx> for SelectionCandidate<'tcx> {
26342634
impl<'tcx> SelectionCache<'tcx> {
26352635
pub fn new() -> SelectionCache<'tcx> {
26362636
SelectionCache {
2637-
hashmap: RefCell::new(HashMap::new())
2637+
hashmap: RefCell::new(FnvHashMap())
26382638
}
26392639
}
26402640
}

0 commit comments

Comments
 (0)