Provide independent implementation for ArrayList.add(E).

To improve performance. Also, see #310
This commit is contained in:
Alexey Andreev 2017-10-24 23:06:43 +03:00
parent 9528e33462
commit 6848984a10

View File

@ -84,6 +84,14 @@ public class TArrayList<E> extends TAbstractList<E> implements TCloneable, TSeri
return old;
}
@Override
public boolean add(E element) {
ensureCapacity(size + 1);
array[size++] = element;
++modCount;
return true;
}
@Override
public void add(int index, E element) {
checkIndexForAdd(index);