mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
don't null out array in ArrayList when size goes to zero
This avoids thrashing in the case of a list which is frequently emptied and refilled with a small number of elements.
This commit is contained in:
parent
c711ac5701
commit
adcac443e4
@ -38,8 +38,6 @@ public class ArrayList<T> extends AbstractList<T> {
|
|||||||
private void shrink() {
|
private void shrink() {
|
||||||
if (array.length / 2 >= MinimumCapacity && size <= array.length / 3) {
|
if (array.length / 2 >= MinimumCapacity && size <= array.length / 3) {
|
||||||
resize(array.length / 2);
|
resize(array.length / 2);
|
||||||
} else if (size == 0) {
|
|
||||||
resize(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user