From 7c30a888ea07fadc67817c998ed1936cc13efe05 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 24 Sep 2015 11:05:48 -0400 Subject: [PATCH] loader: identified_files_by_path also cache the relative path Signed-off-by: Jean Privat --- src/loader.nit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/loader.nit b/src/loader.nit index 00d957a..bc268fa 100644 --- a/src/loader.nit +++ b/src/loader.nit @@ -352,10 +352,12 @@ redef class ModelBuilder end # Fast track, the path is already known - var pn = path.basename(".nit") + if identified_files_by_path.has_key(path) then return identified_files_by_path[path] var rp = module_absolute_path(path) if identified_files_by_path.has_key(rp) then return identified_files_by_path[rp] + var pn = path.basename(".nit") + # Search for a group var mgrouppath = path.join_path("..").simplify_path var mgroup = get_mgroup(mgrouppath) @@ -380,6 +382,7 @@ redef class ModelBuilder mgroup.module_paths.add(res) identified_files_by_path[rp] = res + identified_files_by_path[path] = res identified_files.add(res) return res end -- 1.7.9.5