From 062019590d70279d82fef3a60a2caf9490f8b97b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 15 Oct 2018 21:25:54 +0300 Subject: Switch to the master of salsa --- crates/ra_analysis/src/db/mod.rs | 4 ++-- crates/ra_analysis/src/roots.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_analysis/src') diff --git a/crates/ra_analysis/src/db/mod.rs b/crates/ra_analysis/src/db/mod.rs index c54d50252..c84bfa7a8 100644 --- a/crates/ra_analysis/src/db/mod.rs +++ b/crates/ra_analysis/src/db/mod.rs @@ -2,9 +2,9 @@ use std::{ fmt, sync::Arc, hash::{Hash, Hasher}, - collections::HashSet, }; use salsa; +use rustc_hash::FxHashSet; use ra_syntax::File; use ra_editor::{LineIndex}; use crate::{ @@ -63,7 +63,7 @@ salsa::query_group! { #[derive(Default, Debug)] pub(crate) struct FileSet { - pub(crate) files: HashSet, + pub(crate) files: FxHashSet, pub(crate) resolver: FileResolverImp, } diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs index 908f49b0a..692a07ccd 100644 --- a/crates/ra_analysis/src/roots.rs +++ b/crates/ra_analysis/src/roots.rs @@ -1,5 +1,4 @@ use std::{ - collections::{HashMap, HashSet}, sync::Arc, panic, }; @@ -8,6 +7,7 @@ use parking_lot::RwLock; use once_cell::sync::OnceCell; use rayon::prelude::*; use salsa::Database; +use rustc_hash::{FxHashMap, FxHashSet}; use ra_editor::LineIndex; use ra_syntax::File; @@ -40,8 +40,8 @@ impl WritableSourceRoot { file_resolver: Option, ) -> WritableSourceRoot { let db = self.db.write(); - let mut changed = HashSet::new(); - let mut removed = HashSet::new(); + let mut changed = FxHashSet::default(); + let mut removed = FxHashSet::default(); for (file_id, text) in changes { match text { None => { @@ -55,7 +55,7 @@ impl WritableSourceRoot { } } let file_set = db.file_set(()); - let mut files: HashSet = file_set + let mut files: FxHashSet = file_set .files .clone(); for file_id in removed { -- cgit v1.2.3