diff --git a/rdmd.d b/rdmd.d index ab28e95f3a..c795195961 100644 --- a/rdmd.d +++ b/rdmd.d @@ -679,7 +679,7 @@ private string[string] getDependencies(string rootModule, string workDir, { // See if the deps file is still in good shape auto deps = readDepsFile(); - auto allDeps = chain(rootModule.only, deps.byKey).array; + auto allDeps = chain(rootModule.only, deps.byKey); bool mustRebuildDeps = allDeps.anyNewerThan(depsT); if (!mustRebuildDeps) { @@ -717,40 +717,25 @@ private string[string] getDependencies(string rootModule, string workDir, } // Is any file newer than the given file? -bool anyNewerThan(in string[] files, in string file) +bool anyNewerThan(T)(T files, in string file) { yap("stat ", file); return files.anyNewerThan(file.timeLastModified); } // Is any file newer than the given file? -bool anyNewerThan(in string[] files, SysTime t) +bool anyNewerThan(T)(T files, SysTime t) { - // Experimental: running newerThan in separate threads, one per file - if (false) + bool result; + foreach (source; taskPool.parallel(files)) { - foreach (source; files) - { - if (source.newerThan(t)) - { - return true; - } - } - return false; - } - else - { - bool result; - foreach (source; taskPool.parallel(files)) + yap("stat ", source); + if (!result && source.newerThan(t)) { - yap("stat ", source); - if (!result && source.newerThan(t)) - { - result = true; - } + result = true; } - return result; } + return result; } /*