From a33e4b1d7648934ae57a2c8cfb0ad06408029c66 Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 6 Sep 2016 16:15:07 +0200 Subject: [PATCH] use Collections.addAll rather manually copying array --- .../action/admin/indices/stats/CommonStatsFlags.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java b/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java index 9bacbd2678e..7d6e7c124cd 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java @@ -24,6 +24,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import java.io.IOException; +import java.util.Collections; import java.util.EnumSet; public class CommonStatsFlags implements Writeable, Cloneable { @@ -44,9 +45,7 @@ public class CommonStatsFlags implements Writeable, Cloneable { public CommonStatsFlags(Flag... flags) { if (flags.length > 0) { clear(); - for (Flag f : flags) { - this.flags.add(f); - } + Collections.addAll(this.flags, flags); } }