mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Provide independent implementation for ArrayList.add(E).
To improve performance. Also, see #310
This commit is contained in:
parent
9528e33462
commit
6848984a10
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user