From 27fa4aa60670b37253461ecec2aa6dcd6b074eea Mon Sep 17 00:00:00 2001 From: David Date: Sun, 18 Aug 2013 23:52:07 +0200 Subject: [PATCH] don't add import paths twice --- modulecache.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modulecache.d b/modulecache.d index a5fba32..6033295 100644 --- a/modulecache.d +++ b/modulecache.d @@ -26,6 +26,7 @@ import stdx.d.ast; import std.stdio; import std.array; import std.path; +import std.algorithm; import acvisitor; import actypes; @@ -57,7 +58,7 @@ struct ModuleCache */ static void addImportPath(string path) { - if (!exists(path)) + if (!exists(path) || importPaths.canFind(path)) return; importPaths ~= path; foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))