From a668f703fa5361f59a170d40be667c7e59a4a3e5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 4 Sep 2018 05:09:39 +0300 Subject: micro-optimize --- crates/libanalysis/src/imp.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/libanalysis/src') 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 { } pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> { - let module_map = self.root(file_id).module_map(); + let root = self.root(file_id); + let module_map = root.module_map(); let id = module_map.file2module(file_id); module_map .parent_modules( id, &*self.file_resolver, - &|file_id| self.file_syntax(file_id), + &|file_id| root.syntax(file_id), ) .into_iter() .map(|(id, name, node)| { -- cgit v1.2.3