diff options
author | Edwin Cheng <[email protected]> | 2019-12-07 01:50:21 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-12-07 01:50:21 +0000 |
commit | e5997e174666435acd5abb4531f833bd41bbdb00 (patch) | |
tree | d4366cd41153bbe40f7f6a886221fcf17b12311a /crates/ra_hir_def/src/nameres | |
parent | 76ff5b7c15b2c4e85895a49e5859e546d1d6227e (diff) |
Push glob_imports only if non-exists
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 08693cb13..252178b6b 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -352,10 +352,10 @@ where | |||
352 | 352 | ||
353 | self.update(module_id, Some(import_id), &items); | 353 | self.update(module_id, Some(import_id), &items); |
354 | // record the glob import in case we add further items | 354 | // record the glob import in case we add further items |
355 | self.glob_imports | 355 | let glob = self.glob_imports.entry(m.local_id).or_default(); |
356 | .entry(m.local_id) | 356 | if !glob.iter().any(|it| *it == (module_id, import_id)) { |
357 | .or_default() | 357 | glob.push((module_id, import_id)); |
358 | .push((module_id, import_id)); | 358 | } |
359 | } | 359 | } |
360 | } | 360 | } |
361 | Some(ModuleDefId::AdtId(AdtId::EnumId(e))) => { | 361 | Some(ModuleDefId::AdtId(AdtId::EnumId(e))) => { |