Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 9 additions & 24 deletions rdmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

/*
Expand Down