Skip to content

Commit

Permalink
Avoid waste in registerNewlyDiscovered... when there aren't any
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 156553687
  • Loading branch information
anakanemison authored and iirina committed May 22, 2017
1 parent a79015e commit 31dbadf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -629,8 +630,13 @@ private static void registerNewlyDiscoveredDepsForDoneEntry(
Set<SkyKey> oldDeps,
SkyFunctionEnvironment env)
throws InterruptedException {
Iterator<SkyKey> it = env.getNewlyRequestedDeps().iterator();
if (!it.hasNext()) {
return;
}
Set<SkyKey> unfinishedDeps = new HashSet<>();
for (SkyKey dep : env.getNewlyRequestedDeps()) {
while (it.hasNext()) {
SkyKey dep = it.next();
if (!isDoneForBuild(newlyRequestedDepMap.get(dep))) {
unfinishedDeps.add(dep);
}
Expand Down

0 comments on commit 31dbadf

Please sign in to comment.