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 org.elasticsearch.common.io.stream.Writeable;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
public class CommonStatsFlags implements Writeable, Cloneable {
|
public class CommonStatsFlags implements Writeable, Cloneable {
|
||||||
|
@ -44,9 +45,7 @@ public class CommonStatsFlags implements Writeable, Cloneable {
|
||||||
public CommonStatsFlags(Flag... flags) {
|
public CommonStatsFlags(Flag... flags) {
|
||||||
if (flags.length > 0) {
|
if (flags.length > 0) {
|
||||||
clear();
|
clear();
|
||||||
for (Flag f : flags) {
|
Collections.addAll(this.flags, flags);
|
||||||
this.flags.add(f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue