aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/db/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/db/imp.rs')
-rw-r--r--crates/ra_analysis/src/db/imp.rs9
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};
8use rustc_hash::FxHashMap;
8use salsa; 9use salsa;
9use {FileId, imp::FileResolverImp}; 10use {FileId, imp::FileResolverImp};
10use super::{State, Query, QueryCtx}; 11use 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)]
15pub(super) struct Db { 16pub(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
86pub(super) struct QueryRegistry { 87pub(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
91impl QueryRegistry { 92impl 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 }