[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Collections ArrayList
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Collections ArrayList.cs,1.10,1.11 |
Date: |
Sat, 01 Feb 2003 18:26:06 -0500 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections
In directory subversions:/tmp/cvs-serv962/runtime/System/Collections
Modified Files:
ArrayList.cs
Log Message:
ArrayList: double the size of the array when reallocating, rather than
just adding 32.
Index: ArrayList.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Collections/ArrayList.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** ArrayList.cs 16 Dec 2002 23:31:03 -0000 1.10
--- ArrayList.cs 1 Feb 2003 23:26:04 -0000 1.11
***************
*** 89,92 ****
--- 89,97 ----
// We need to allocate a new array.
int newCapacity = (((count + n) + 31) &
~31);
+ int newCapacity2 = count * 2;
+ if(newCapacity2 > newCapacity)
+ {
+ newCapacity = newCapacity2;
+ }
Object[] newStore = new Object
[newCapacity];
if(index != 0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Collections ArrayList.cs,1.10,1.11,
Rhys Weatherley <address@hidden> <=