Optimized array allocation

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
kaizimmerm
2016-09-30 09:12:39 +02:00
parent e08962cf8f
commit de6b5cd93d

View File

@@ -74,8 +74,13 @@ public class ActionUpdateStatus {
}
public boolean addMessage(final Collection<String> messages) {
if (messages == null || messages.isEmpty()) {
return false;
}
if (this.message == null) {
this.message = new ArrayList<>();
this.message = new ArrayList<>(messages);
return true;
}
return this.message.addAll(messages);