2010-03-19 Sebastien Pouliot <[email protected]>
* CollectionDebuggerView.cs: Change to internal so we can avoid
a duplicating the type in assemblies that have [InternalsVisibleTo]
In System.Collections.Generic:
2010-03-19 Sebastien Pouliot <[email protected]>
* CollectionDebuggerView.cs: Change to internal so we can avoid
a duplicating the type in assemblies that have [InternalsVisibleTo]
svn path=/trunk/mcs/; revision=153915
2010-01-24 Robert Jordan <[email protected]>
* Dictionary.cs: Fix deserialization compatibility with MS.NET.
Fixes bug #474009.
In Test/System.Collections.Generic:
2010-01-24 Robert Jordan <[email protected]>
* DictionaryTest.cs: Add test case for bug #474009.
svn path=/trunk/mcs/; revision=150089
* Dictionary.cs: Always create the keys, fixes compatibility
between Mono and .NET. Patch from John Lenz <[email protected]>
svn path=/trunk/mcs/; revision=149947
2009-12-06 Chris Toshok <[email protected]>
* KeyValuePair.cs: we need setters for Key and Value so they can
be set via reflection from
System.ServiceModel.System.Runtime.Serialization.Json.TypeMap.cs.
in class/System.ServiceModel.Web/System.Runtime.Serialization.Json/:
2009-12-06 Chris Toshok <[email protected]>
* JsonSerializationReader.cs (DeserializeGenericCollection): this
is jb's (iirc) patch, actually. Types subclassing from
ICollection<T> need to be supported, and since it's an interface
the implementation might be explicit. So instead of groveling
around in the actual type, we need to dispatch through the
interface's method.
* TypeMap.cs (CreateDefaultTypeMap): we need to include non-public
properties, since KeyValuePair items must be able to write to Key
and Value properties.
* JsonReader.cs (ReadContent): for builtin values (null, true,
false), use TryReadString instead of individual ReadChar's, since
they aren't reversible if the string didn't match. In the default
case, if we're LameSilverlightLiseralParser, we need to push back
the current character onto the stream -- this is because for
netflix's AppConfig.json we were parsing "frameRatePolicy" as
"rameRatePolicy" (the 'f' was triggering the "false" parsing).
(class PushBackReader): add this class to unify all the pushing
back of characters we need to do. 1 character (JsonReader's old
"saved_char") isn't enough given that you could have a property
named, e.g., "falsifiable", and we'd need 4 characters worth of
pushback to recognize that correctly.
svn path=/trunk/mcs/; revision=147766
* List.cs (Sort): Call more appropriate overload of Array.Sort<T>.
Array.Sort<T> should be able to determine the comparison itself.
Speeds up the sorting for items of primitive type.
Fixes#530450.
svn path=/trunk/mcs/; revision=146704
* Dictionary.cs: cast target array to TRet[] instead of object[] -
may fail, but otherwise it doesn't compile with 2.4 (e.g. when
bootstrapping trunk)
svn path=/trunk/mcs/; revision=143188
* System.Collections.Generic/Dictionary.cs (CopyToCheck, Do_CopyTo):
Carve out of ...
(CopyTo): ... this.
(Do_ICollectionCopyTo): Carve out of ICollection.CopyTo. Convert
type-cast exceptions to ArgumentExceptions.
(KeyCollection.CopyTo): Use them.
(ValueCollection.CopyTo): Use them.
* Test/System.Collections.Generic/DictionaryTest.cs (ICollectionCopyTo):
Test various odd scenarios where .NET CopyTo does _not_ throw an exception.
(ICollectionCopyTo_ex1..4): Ensure that ArgumentExceptions are
thrown in appropriate cases.
svn path=/trunk/mcs/; revision=142427
* List.cs (IList.this.set): Convert NullReference and InvalidCast
exceptions into ArgumentExceptions.
(IList.Add, IList.Contains, IList.IndexOf, IList.Insert, IList.Remove):
Convert NullReferenceException to ArgumentException.
* ListTest.cs: Add a few testcases for IList interface, using null
values with a List<int>.
svn path=/trunk/mcs/; revision=139159
* System.Collections.Generic/List.cs (Enumerator.current): New.
(Enumerator.MoveNext): Update it.
(Enumerator.Current): Don't verify any invariants.
(Enumerator.Dispose): Set 'l' to null.
* Test/System.Collections.Generic/ListTest.cs (Enumerator_Current):
New test, includes relevant parts of #491858 and #517415.
svn path=/trunk/mcs/; revision=139087
* System.Collections.Generic/Dictionary.cs (Enumerator.current): New.
(Enumerator.MoveNext): Update it.
(Enumerator.Current): Don't verify any invariants.
* Test/System.Collections.Generic/DictionaryTest.cs (Enumerator_Current):
New test, includes relevant parts of #491858 and #517415.
svn path=/trunk/mcs/; revision=139082
* Dictionary.cs (ValueCollection.CopyTo): fix for copying to
an object array. Based on a patch by Tobias Grimm <[email protected]>.
Fixes bug #328036.
svn path=/trunk/mcs/; revision=130884
* Dictionary.cs: Declare the Link struct outside the main class to avoid
creating a separate inflated instances for each instantiation of Dictionary.
svn path=/trunk/mcs/; revision=125739
* Dictionary.cs (ICollection.CopyTo): fix the different possible
copying cases depending on the actual type of destination array,
be it an array of KeyValuePair, DictionaryEntry, or object.
Fixes#444778.
svn path=/trunk/mcs/; revision=118841
* Dictionary.cs: fix ICollection<KeyValuePair<T>>.Remove and .Contains
to not only check if the key exists but if the associated value is the
good one as well. Fixes#444768.
svn path=/trunk/mcs/; revision=118838
* Dictionary.cs (Clear): Clear the linkSlots array as well, as
Enumerator.MoveNext () depends on it. Fixes#432441.
svn path=/trunk/mcs/; revision=114915
* Dictionary.cs: (ToTValue) allow null values to be added for non
value types TValues to the dictionary when using the
non generic IDictionary. Fixes#425693.
svn path=/trunk/mcs/; revision=112907
* String.cs: Dictionary: Do not change the index data when using the indexer for
an already existing index. This is somewhat illogical and breakes obscure code situations
svn path=/trunk/mcs/; revision=105870
* List.cs (RemoveAll, Shift): Fix leak by clearing empty array
items.
2008-05-29 Juraj Skripsky <[email protected]>
* ArrayList.cs: Create the empty array only once and reuse it.
svn path=/trunk/mcs/; revision=104415
2007-10-10 Juraj Skripsky <[email protected]>
* Dictionary.cs (Enumerator.MoveNext): Handle the case where we
had already reached the end. Fixes bug #332534.
svn path=/trunk/mcs/; revision=88534
* Dictionary.cs: Optimize and add implementation notes. Use a "mini-heap"
to store the linked lists instead of the regular heap. Split arrays of
structs into separate arrays to make the GC's life simpler (see bug 81879
for details). Make class serialization compatible with MS.NET.
* EqualityComparer.cs: Rename IEquatableOfTEqualityComparer<T> to
GenericEqualityComparer<T> to fix binary serialization compatibility
with MS.
svn path=/trunk/mcs/; revision=80341
* List.cs (FindAllStackBits): Small optimization to the new code.
Built resulting List<T> directly as an array, wrap it in a List<T>
afterwards. Stop the filling of the result array as soon as all
matching items have been processed.
svn path=/trunk/mcs/; revision=74715
* List.cs (FindAll): Optimize FindAll using a bitmask to
* determine
the number of positive matches, this increases the performance
in
all cases below 10,000,000 elements extensively:
100 elements:
old method: 00:00:00.0126610 (26x)
stackalloc bit method: 00:00:00.0004750 (1x)
array bit method: 00:00:00.0010700 (2x)
heap bit method: 00:00:00.0038830 (8x)
1,000 elements:
old method: 00:00:00.0139250 (24x)
stackalloc bit method: 00:00:00.0005670 (1x)
array bit method: 00:00:00.0010890 (2x)
heap bit method: 00:00:00.0034920 (6x)
10,000 elements:
old method: 00:00:00.0136110 (12x)
stackalloc bit method: 00:00:00.0011240 (1x)
array bit method: 00:00:00.0016450 (1.4x)
heap bit method: 00:00:00.0043110 (3x)
50,000 elements:
old method: 00:00:00.0175970 (3x)
stackalloc bit method: 00:00:00.0085630 (1.5x)
array bit method: 00:00:00.0055010 (1x)
heap bit method: 00:00:00.0099590 (1.8x)
100,000 elements:
old method: 00:00:00.0210330 (2x)
array bit method: 00:00:00.0100430 (1x)
heap bit method: 00:00:00.0154150 (1.5x)
1,000,000 elements:
old method: 00:00:00.1243730 (1.2x)
array bit method: 00:00:00.0973110 (1x)
heap bit method: 00:00:00.1285650 (1.3x)
10,000,000 elements:
old method: 00:00:00.9252570 (1x)
array bit method: 00:00:00.9632300 ( 1.05x)
heap bit method: 00:00:01.1098490 (1.20x)
svn path=/trunk/mcs/; revision=74694
* List.cs: Fix the case where List.set_Item(int index) throws
inappropriate exception when index is equal to List.Count
List.IndexOf(object item) and IList.Contains(object item) throw
exceptions when given invalid types.
IList.Add(object item) throws InvalidCastException when item is
not of the correct type.
svn path=/trunk/mcs/; revision=73976