Avoid unnecessary allocations in ConditionMessage for NORMAL style

See gh-22330
pull/22996/head
dreis2211 4 years ago committed by Stephane Nicoll
parent 603e65a629
commit de30e5c6ac

@ -405,6 +405,11 @@ public final class ConditionMessage {
protected Object applyToItem(Object item) { protected Object applyToItem(Object item) {
return item; return item;
} }
@Override
public Collection<?> applyTo(Collection<?> items) {
return items;
}
}, },
QUOTE { QUOTE {
@ -415,7 +420,7 @@ public final class ConditionMessage {
}; };
public Collection<?> applyTo(Collection<?> items) { public Collection<?> applyTo(Collection<?> items) {
List<Object> result = new ArrayList<>(); List<Object> result = new ArrayList<>(items.size());
for (Object item : items) { for (Object item : items) {
result.add(applyToItem(item)); result.add(applyToItem(item));
} }

Loading…
Cancel
Save