From 11c7589db514421278546a34c36767b3cd5746c2 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 13 Dec 2004 06:42:53 +0000 Subject: [PATCH] Don't choke trying to accomodate when the initial array size was 0. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1543 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/src/java/com/samskivert/util/IntListUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java b/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java index 684df911..03cd0806 100644 --- a/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java +++ b/projects/samskivert/src/java/com/samskivert/util/IntListUtil.java @@ -444,7 +444,7 @@ public class IntListUtil int size = list.length; // expand size by powers of two until we're big enough while (size <= index) { - size *= 2; + size = Math.max(size * 2, DEFAULT_LIST_SIZE); } // create a new list and copy the contents