When constructing a set with an array of values, copy and sort the array rather
than doing individual add()s. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2556 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -41,7 +41,8 @@ public class ArrayIntSet extends AbstractSet<Integer>
|
|||||||
public ArrayIntSet (int[] values)
|
public ArrayIntSet (int[] values)
|
||||||
{
|
{
|
||||||
this(values.length);
|
this(values.length);
|
||||||
add(values);
|
System.arraycopy(values, 0, _values, 0, values.length);
|
||||||
|
Arrays.sort(_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user