Merge branch 'master' of https://github.com/mono/mono into issue4328
[mono.git] / mcs / class / System / System.Collections.Generic / SortedList.cs
index 259d0f8236f17714cf254a3f9dd41474103812c4..c1190b2ad26d67daeeecc6c79191814e56db3879 100644 (file)
@@ -305,16 +305,12 @@ namespace System.Collections.Generic
 
                void ICollection<KeyValuePair<TKey, TValue>>.Clear () 
                {
-                       defaultCapacity = INITIAL_SIZE;
-                       this.table = new KeyValuePair<TKey, TValue> [defaultCapacity];
-                       inUse = 0;
-                       modificationCount++;
+                       Clear ();
                }
 
                public void Clear () 
                {
-                       defaultCapacity = INITIAL_SIZE;
-                       this.table = new KeyValuePair<TKey, TValue> [defaultCapacity];
+                       Array.Clear (table, 0, table.Length);
                        inUse = 0;
                        modificationCount++;
                }