mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-09 08:24:10 -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;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean add(E element) {
|
||||||
|
ensureCapacity(size + 1);
|
||||||
|
array[size++] = element;
|
||||||
|
++modCount;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(int index, E element) {
|
public void add(int index, E element) {
|
||||||
checkIndexForAdd(index);
|
checkIndexForAdd(index);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user