add special implementation for add
The special implementation does not need to allocate an array for the varargs of addAll
This commit is contained in:
@@ -112,9 +112,10 @@ public class IntList {
|
||||
* the value to add
|
||||
*/
|
||||
public void add(final int value) {
|
||||
// TODO add a special implementation that does not
|
||||
// need to allocate an array for the varargs of addAll
|
||||
addAll(value);
|
||||
ensureCapacity(1);
|
||||
|
||||
data[index] = value;
|
||||
index++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user