Create less garbage for the common case of not having any aspects.
RELNOTES: None.
@@ -631,9 +631,9 @@ public abstract class DependencyResolver {
* Filter the set of aspects that are to be propagated according to the set of advertised
* providers of the dependency.
*/
- private AspectCollection filterPropagatingAspects(Iterable<Aspect> aspects, Target toTarget)
+ private AspectCollection filterPropagatingAspects(ImmutableList<Aspect> aspects, Target toTarget)
throws InconsistentAspectOrderException {
- if (!(toTarget instanceof Rule)) {
+ if (!(toTarget instanceof Rule) || aspects.isEmpty()) {
return AspectCollection.EMPTY;
}
