use Collections.addAll rather manually copying array
This commit is contained in:
parent
1ff22fe32a
commit
a33e4b1d76
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue