From 640e5e2dd963be503c40032a2eb3564e7e797bc8 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 17 Jun 2016 15:37:59 -0400 Subject: [PATCH] loader: simplify special cases of identify_module Signed-off-by: Jean Privat --- src/loader.nit | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/loader.nit b/src/loader.nit index 0cd3331..7f5a245 100644 --- a/src/loader.nit +++ b/src/loader.nit @@ -356,7 +356,7 @@ redef class ModelBuilder last_loader_error = null # special case for not a nit file - if not path.has_suffix(".nit") then + if not path.has_suffix(".nit") then do # search dirless files in known -I paths if not path.chars.has('/') then var res = search_module_in_paths(null, path, self.paths) @@ -364,19 +364,19 @@ redef class ModelBuilder end # Found nothing? maybe it is a group... - var candidate = null if path.file_exists then var mgroup = identify_group(path) if mgroup != null then var owner_path = mgroup.filepath.join_path(mgroup.name + ".nit") - if owner_path.file_exists then candidate = owner_path + if owner_path.file_exists then + path = owner_path + break + end end end - if candidate == null then - return null - end - path = candidate + + return null end # Does the file exists? -- 1.7.9.5