Skip to content

Commit

Permalink
Add clarifying comment to DependencyResolver.
Browse files Browse the repository at this point in the history
* Adds a clarifying comment to explain a surprising implementation.

PiperOrigin-RevId: 493694784
Change-Id: I37cbf23153761a3539acd6fe47deba5a3bdd01a0
  • Loading branch information
aoeui authored and copybara-github committed Dec 7, 2022
1 parent 8a53b0e commit 9376eb9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ private void addAspectAttributes(
private static AspectCollection computeAspectCollections(
ImmutableList<Aspect> aspects, Target toTarget) throws InconsistentAspectOrderException {
if (toTarget instanceof OutputFile) {
// When applyToGeneratingRules holds, the aspect cannot have required providers so it's
// possible to skip the filtering that happens further below. However,
// apply_to_generating_rules is rare in the codebase so the optimization is not worth it.
aspects =
aspects.stream()
.filter(aspect -> aspect.getDefinition().applyToGeneratingRules())
Expand Down

0 comments on commit 9376eb9

Please sign in to comment.