aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-15 14:45:34 +0100
committerAleksey Kladov <[email protected]>2020-07-15 14:45:34 +0100
commit760ee8173c59976ca111040bc017b57df105768d (patch)
tree3eec00cce792f5a65636fa8dd7fcab82031f2385 /crates
parenta40e05dd5d8b2c5f74c61cd08efed9dc83124657 (diff)
Micro-optimize update
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs11
1 files changed, 6 insertions, 5 deletions
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<'_> {
609 .get(&module_id) 609 .get(&module_id)
610 .into_iter() 610 .into_iter()
611 .flat_map(|v| v.iter()) 611 .flat_map(|v| v.iter())
612 .filter(|(glob_importing_module, _)| {
613 // we know all resolutions have the same visibility (`vis`), so we
614 // just need to check that once
615 vis.is_visible_from_def_map(&self.def_map, *glob_importing_module)
616 })
612 .cloned() 617 .cloned()
613 .collect::<Vec<_>>(); 618 .collect::<Vec<_>>();
619
614 for (glob_importing_module, glob_import_vis) in glob_imports { 620 for (glob_importing_module, glob_import_vis) in glob_imports {
615 // we know all resolutions have the same visibility (`vis`), so we
616 // just need to check that once
617 if !vis.is_visible_from_def_map(&self.def_map, glob_importing_module) {
618 continue;
619 }
620 self.update_recursive( 621 self.update_recursive(
621 glob_importing_module, 622 glob_importing_module,
622 resolutions, 623 resolutions,