Also don't choke expanding a zero size array.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1544 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -487,7 +487,7 @@ public class ListUtil
|
|||||||
int size = list.length;
|
int size = list.length;
|
||||||
// expand size by powers of two until we're big enough
|
// expand size by powers of two until we're big enough
|
||||||
while (size <= index) {
|
while (size <= index) {
|
||||||
size *= 2;
|
size = Math.max(size * 2, DEFAULT_LIST_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new list and copy the contents
|
// create a new list and copy the contents
|
||||||
|
|||||||
Reference in New Issue
Block a user