From dc2b30e9b6084048e441765b91ef830a836d3dfc Mon Sep 17 00:00:00 2001
From: Muhammad Mominul Huque <mominul2082@gmail.com>
Date: Fri, 12 Oct 2018 00:07:44 +0600
Subject: Replace HashMap, HashSet with FxHashMap and FxHashSet

---
 crates/ra_analysis/src/db/imp.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'crates/ra_analysis/src/db')

diff --git a/crates/ra_analysis/src/db/imp.rs b/crates/ra_analysis/src/db/imp.rs
index f26be1046..36f6cf290 100644
--- a/crates/ra_analysis/src/db/imp.rs
+++ b/crates/ra_analysis/src/db/imp.rs
@@ -2,9 +2,10 @@ use std::{
     sync::Arc,
     any::Any,
     hash::{Hash, Hasher},
-    collections::hash_map::{DefaultHasher, HashMap},
+    collections::hash_map::{DefaultHasher},
     iter,
 };
+use rustc_hash::FxHashMap;
 use salsa;
 use {FileId, imp::FileResolverImp};
 use super::{State, Query, QueryCtx};
@@ -13,7 +14,7 @@ pub(super) type Data = Arc<Any + Send + Sync + 'static>;
 
 #[derive(Debug)]
 pub(super) struct Db {
-    names: Arc<HashMap<salsa::QueryTypeId, &'static str>>,
+    names: Arc<FxHashMap<salsa::QueryTypeId, &'static str>>,
     pub(super) imp: salsa::Db<State, Data>,
 }
 
@@ -85,7 +86,7 @@ where
 
 pub(super) struct QueryRegistry {
     config: Option<salsa::QueryConfig<State, Data>>,
-    names: HashMap<salsa::QueryTypeId, &'static str>,
+    names: FxHashMap<salsa::QueryTypeId, &'static str>,
 }
 
 impl QueryRegistry {
@@ -109,7 +110,7 @@ impl QueryRegistry {
                 (Arc::new(res), fingerprint)
             })
         );
-        let mut names = HashMap::new();
+        let mut names = FxHashMap::default();
         names.insert(FILE_TEXT, "FILE_TEXT");
         names.insert(FILE_SET, "FILE_SET");
         QueryRegistry { config: Some(config), names }
-- 
cgit v1.2.3