From 760ee8173c59976ca111040bc017b57df105768d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 15 Jul 2020 15:45:34 +0200 Subject: Micro-optimize update --- crates/ra_hir_def/src/nameres/collector.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index e55cc1e55..99ac730ba 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -609,14 +609,15 @@ impl DefCollector<'_> { .get(&module_id) .into_iter() .flat_map(|v| v.iter()) + .filter(|(glob_importing_module, _)| { + // we know all resolutions have the same visibility (`vis`), so we + // just need to check that once + vis.is_visible_from_def_map(&self.def_map, *glob_importing_module) + }) .cloned() .collect::>(); + for (glob_importing_module, glob_import_vis) in glob_imports { - // we know all resolutions have the same visibility (`vis`), so we - // just need to check that once - if !vis.is_visible_from_def_map(&self.def_map, glob_importing_module) { - continue; - } self.update_recursive( glob_importing_module, resolutions, -- cgit v1.2.3