Skip to content

Commit

Permalink
Remove unneccsary array allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Aug 26, 2016
1 parent 60b0185 commit 7b3be82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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,14 +717,14 @@ 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)
Expand Down

0 comments on commit 7b3be82

Please sign in to comment.