Author: spouliot
Date: 2005-12-19 10:55:19 -0500 (Mon, 19 Dec 2005)
New Revision: 54605
Modified:
trunk/mcs/class/corlib/System.Collections/ArrayList.cs
trunk/mcs/class/corlib/System.Collections/ChangeLog
Log:
2005-12-19 Sebastien Pouliot <[EMAIL PROTECTED]>
* ArrayList.cs: Fix default capacity under 2.0 (and unit tests under
MS 2.0).
Modified: trunk/mcs/class/corlib/System.Collections/ArrayList.cs
===================================================================
--- trunk/mcs/class/corlib/System.Collections/ArrayList.cs 2005-12-19
15:54:00 UTC (rev 54604)
+++ trunk/mcs/class/corlib/System.Collections/ArrayList.cs 2005-12-19
15:55:19 UTC (rev 54605)
@@ -3,30 +3,8 @@
// Implementation of the ECMA ArrayList.
//
// Copyright (c) 2003 Thong (Tum) Nguyen [EMAIL PROTECTED]
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
-// http://www.opensource.org/licenses/mit-license.html
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
copy of this
-// software and associated documentation files (the "Software"), to deal in
the
-// Software without restriction, including without limitation the rights to
use, copy,
-// modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software,
-// and to permit persons to whom the Software is furnished to do so, subject
to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
all copies
-// or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
@@ -47,8 +25,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using System.Collections;
using System.Runtime.InteropServices;
namespace System.Collections
@@ -2512,7 +2488,11 @@
#region Fields
- private const int DefaultInitialCapacity = 0x10;
+#if NET_2_0
+ private const int DefaultInitialCapacity = 4;
+#else
+ private const int DefaultInitialCapacity = 16;
+#endif
/// <summary>
/// Number of items in the list.
@@ -2539,7 +2519,11 @@
/// </summary>
public ArrayList()
{
+#if NET_2_0
+ _items = new object[0];
+#else
_items = new object[DefaultInitialCapacity];
+#endif
}
/// <summary>
Modified: trunk/mcs/class/corlib/System.Collections/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Collections/ChangeLog 2005-12-19 15:54:00 UTC
(rev 54604)
+++ trunk/mcs/class/corlib/System.Collections/ChangeLog 2005-12-19 15:55:19 UTC
(rev 54605)
@@ -1,3 +1,8 @@
+2005-12-19 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * ArrayList.cs: Fix default capacity under 2.0 (and unit tests under
+ MS 2.0).
+
2005-12-07 Sebastien Pouliot <[EMAIL PROTECTED]>
* SortedList.cs: Removed check for IComparable in ctor (fixed bug
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches