Browse Source

2004-06-14 Sebastien Pouliot <[email protected]>

	* Hashtable.cs: Compare index and length in CopyTo only when length > 0.

svn path=/trunk/mcs/; revision=29538
Sebastien Pouliot 21 years ago
parent
commit
55b671bb85

+ 4 - 0
mcs/class/corlib/System.Collections/ChangeLog

@@ -1,3 +1,7 @@
+2004-06-14  Sebastien Pouliot  <[email protected]>
+
+	* Hashtable.cs: Compare index and length in CopyTo only when length > 0.
+
 2004-06-14  Lluis Sanchez Gual  <[email protected]>
 
 	* ArrayList.cs: Avoid endless loop in Insert when the current size is 0.

+ 1 - 6
mcs/class/corlib/System.Collections/Hashtable.cs

@@ -28,15 +28,10 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
-
 using System;
 using System.Collections;
 using System.Runtime.Serialization;
 
-
-
-
 namespace System.Collections {
 
 	[Serializable]
@@ -342,7 +337,7 @@ namespace System.Collections {
 			if (array.Rank > 1)
 				throw new ArgumentException ("array is multidimensional");
 
-			if (arrayIndex >= array.Length)
+			if ((array.Length > 0) && (arrayIndex >= array.Length))
 				throw new ArgumentException ("arrayIndex is equal to or greater than array.Length");
 
 			if (arrayIndex + this.inUse > array.Length)