diff options
author | Muhammad Mominul Huque <[email protected]> | 2018-10-11 19:07:44 +0100 |
---|---|---|
committer | Muhammad Mominul Huque <[email protected]> | 2018-10-11 19:07:44 +0100 |
commit | dc2b30e9b6084048e441765b91ef830a836d3dfc (patch) | |
tree | d36cc20ef7c43d33488706cd65427e5d8922430c /crates/ra_analysis/src/db | |
parent | 9b155c89764b8413df6b32edfde94fce1d9c15ec (diff) |
Replace HashMap, HashSet with FxHashMap and FxHashSet
Diffstat (limited to 'crates/ra_analysis/src/db')
-rw-r--r-- | crates/ra_analysis/src/db/imp.rs | 9 |
1 files changed, 5 insertions, 4 deletions
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::{ | |||
2 | sync::Arc, | 2 | sync::Arc, |
3 | any::Any, | 3 | any::Any, |
4 | hash::{Hash, Hasher}, | 4 | hash::{Hash, Hasher}, |
5 | collections::hash_map::{DefaultHasher, HashMap}, | 5 | collections::hash_map::{DefaultHasher}, |
6 | iter, | 6 | iter, |
7 | }; | 7 | }; |
8 | use rustc_hash::FxHashMap; | ||
8 | use salsa; | 9 | use salsa; |
9 | use {FileId, imp::FileResolverImp}; | 10 | use {FileId, imp::FileResolverImp}; |
10 | use super::{State, Query, QueryCtx}; | 11 | use super::{State, Query, QueryCtx}; |
@@ -13,7 +14,7 @@ pub(super) type Data = Arc<Any + Send + Sync + 'static>; | |||
13 | 14 | ||
14 | #[derive(Debug)] | 15 | #[derive(Debug)] |
15 | pub(super) struct Db { | 16 | pub(super) struct Db { |
16 | names: Arc<HashMap<salsa::QueryTypeId, &'static str>>, | 17 | names: Arc<FxHashMap<salsa::QueryTypeId, &'static str>>, |
17 | pub(super) imp: salsa::Db<State, Data>, | 18 | pub(super) imp: salsa::Db<State, Data>, |
18 | } | 19 | } |
19 | 20 | ||
@@ -85,7 +86,7 @@ where | |||
85 | 86 | ||
86 | pub(super) struct QueryRegistry { | 87 | pub(super) struct QueryRegistry { |
87 | config: Option<salsa::QueryConfig<State, Data>>, | 88 | config: Option<salsa::QueryConfig<State, Data>>, |
88 | names: HashMap<salsa::QueryTypeId, &'static str>, | 89 | names: FxHashMap<salsa::QueryTypeId, &'static str>, |
89 | } | 90 | } |
90 | 91 | ||
91 | impl QueryRegistry { | 92 | impl QueryRegistry { |
@@ -109,7 +110,7 @@ impl QueryRegistry { | |||
109 | (Arc::new(res), fingerprint) | 110 | (Arc::new(res), fingerprint) |
110 | }) | 111 | }) |
111 | ); | 112 | ); |
112 | let mut names = HashMap::new(); | 113 | let mut names = FxHashMap::default(); |
113 | names.insert(FILE_TEXT, "FILE_TEXT"); | 114 | names.insert(FILE_TEXT, "FILE_TEXT"); |
114 | names.insert(FILE_SET, "FILE_SET"); | 115 | names.insert(FILE_SET, "FILE_SET"); |
115 | QueryRegistry { config: Some(config), names } | 116 | QueryRegistry { config: Some(config), names } |