From dc2b30e9b6084048e441765b91ef830a836d3dfc Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Fri, 12 Oct 2018 00:07:44 +0600 Subject: Replace HashMap, HashSet with FxHashMap and FxHashSet --- crates/ra_editor/src/folding_ranges.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_editor/src/folding_ranges.rs') diff --git a/crates/ra_editor/src/folding_ranges.rs b/crates/ra_editor/src/folding_ranges.rs index 733512368..3aabd54ae 100644 --- a/crates/ra_editor/src/folding_ranges.rs +++ b/crates/ra_editor/src/folding_ranges.rs @@ -1,4 +1,4 @@ -use std::collections::HashSet; +use rustc_hash::FxHashSet; use ra_syntax::{ File, TextRange, SyntaxNodeRef, @@ -20,7 +20,7 @@ pub struct Fold { pub fn folding_ranges(file: &File) -> Vec { let mut res = vec![]; - let mut visited = HashSet::new(); + let mut visited = FxHashSet::default(); for node in file.syntax().descendants() { if visited.contains(&node) { @@ -56,7 +56,7 @@ pub fn folding_ranges(file: &File) -> Vec { fn contiguous_range_for<'a>( kind: SyntaxKind, node: SyntaxNodeRef<'a>, - visited: &mut HashSet>, + visited: &mut FxHashSet>, ) -> Option { visited.insert(node); -- cgit v1.2.3