aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-04 03:09:39 +0100
committerAleksey Kladov <[email protected]>2018-09-04 03:09:39 +0100
commita668f703fa5361f59a170d40be667c7e59a4a3e5 (patch)
tree483a7941d40abd3fc8d630782c2959492a2a15ef
parent294534abc7471604e0700d28aaac51000aff8c3e (diff)
micro-optimize
-rw-r--r--crates/libanalysis/src/imp.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/libanalysis/src/imp.rs b/crates/libanalysis/src/imp.rs
index 50855551e..e3ccffbf0 100644
--- a/crates/libanalysis/src/imp.rs
+++ b/crates/libanalysis/src/imp.rs
@@ -113,13 +113,14 @@ impl AnalysisImpl {
113 113
114 } 114 }
115 pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> { 115 pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> {
116 let module_map = self.root(file_id).module_map(); 116 let root = self.root(file_id);
117 let module_map = root.module_map();
117 let id = module_map.file2module(file_id); 118 let id = module_map.file2module(file_id);
118 module_map 119 module_map
119 .parent_modules( 120 .parent_modules(
120 id, 121 id,
121 &*self.file_resolver, 122 &*self.file_resolver,
122 &|file_id| self.file_syntax(file_id), 123 &|file_id| root.syntax(file_id),
123 ) 124 )
124 .into_iter() 125 .into_iter()
125 .map(|(id, name, node)| { 126 .map(|(id, name, node)| {