Showing with 9 additions and 24 deletions.
  1. +9 −24 rdmd.d
33 changes: 9 additions & 24 deletions rdmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,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)
{
Expand Down Expand Up @@ -718,40 +718,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;
}

/*
Expand Down