Skip to content

Commit

Permalink
Remove unnecessary env.valuesMissing() call.
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=103975426
  • Loading branch information
haxorz authored and hanwen committed Sep 28, 2015
1 parent fbeb09d commit 7bd3e02
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ interface Visitor {
* by {@link #aggregateWithSubdirectorySkyValues}, and returns that aggregation.
*
* <p>Returns null if {@code env.valuesMissing()} is true, checked after each call to one of
* {@link RecursiveDirectoryTraversalFunction}'s abstract methods except for {@link
* #getEmptyReturn}. (And after each of {@code visitDirectory}'s own uses of {@code env}, of
* course.)
* {@link RecursiveDirectoryTraversalFunction}'s abstract methods that were given {@code env}.
* (And after each of {@code visitDirectory}'s own uses of {@code env}, of course.)
*/
TReturn visitDirectory(RecursivePkgKey recursivePkgKey, Environment env) {
RootedPath rootedPath = recursivePkgKey.getRootedPath();
Expand Down Expand Up @@ -151,10 +150,6 @@ TReturn visitDirectory(RecursivePkgKey recursivePkgKey, Environment env) {
}

TVisitor visitor = getInitialVisitor();
if (env.valuesMissing()) {
return null;
}

if (pkgLookupValue.packageExists()) {
if (pkgLookupValue.getRoot().equals(root)) {
Package pkg = null;
Expand Down Expand Up @@ -252,19 +247,12 @@ TReturn visitDirectory(RecursivePkgKey recursivePkgKey, Environment env) {
RootedPath subdirectoryRootedPath = RootedPath.toRootedPath(root, subdirectory);
childDeps.add(getSkyKeyForSubdirectory(recursivePkgKey.getRepository(),
subdirectoryRootedPath, excludedSubdirectoriesBeneathThisSubdirectory));
if (env.valuesMissing()) {
return null;
}
}
Map<SkyKey, SkyValue> subdirectorySkyValues = env.getValues(childDeps);
if (env.valuesMissing()) {
return null;
}
TReturn aggregation = aggregateWithSubdirectorySkyValues(visitor, subdirectorySkyValues);
if (env.valuesMissing()) {
return null;
}
return aggregation;
return aggregateWithSubdirectorySkyValues(visitor, subdirectorySkyValues);
}

// Ignore all errors in traversal and return an empty value.
Expand Down

0 comments on commit 7bd3e02

Please sign in to comment.