Skip to content

Commit

Permalink
Don't iterate over a large map just to delete an empty list of SkyKeys.
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 229715756
  • Loading branch information
Googler authored and Copybara-Service committed Jan 17, 2019
1 parent 4526b4b commit 26d5a40
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ private void invalidateDeletedPackages(Iterable<PackageIdentifier> deletedPackag
for (PackageIdentifier deletedPackage : deletedPackages) {
packagesToInvalidate.add(PackageLookupValue.key(deletedPackage));
}
// Exit early if there are no packages to be deleted to avoid iterating over a large map.
if (packagesToInvalidate.isEmpty()) {
return;
}
memoizingEvaluator.delete(Predicates.in(packagesToInvalidate));
}

Expand Down

0 comments on commit 26d5a40

Please sign in to comment.