Merge pull request #22330 from dreis2211

* pr/22330:
  Avoid unnecessary allocations in ConditionMessage for NORMAL style

Closes gh-22330
pull/22996/head
Stephane Nicoll 4 years ago
commit 7c733bf6d2

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

Loading…
Cancel
Save