In class/corlib/System.Collections.Generic:
[mcs.git] / class / corlib / System.Collections.Generic / ChangeLog
blobc61ce070c7f0911b1a5734c151acc307952c13c3
1 2006-03-16  Ankit Jain  <jankit@novell.com>
3         * List.cs (CheckIndex): Check for -ve indices and allow index == size.
4         (Insert): Use CheckIndex.
6 2006-03-12  Zoltan Varga  <vargaz@gmail.com>
8         * List.cs: Applied patch from <kazuki@panicode.com>. Fixes #77504.
10 2006-02-10  Martin Baulig  <martin@ximian.com>
12         * Comparer.cs
13         (IComparableOfTComparer): `T' must implement `IComparable<T>' and
14         not `IComparable'.
16 Tue Jan 24 18:22:54 CET 2006 Paolo Molaro <lupus@ximian.com>
18         * Dictionary.cs: avoid long reminder operations.
20 2006-01-23  Raja R Harinath  <rharinath@novell.com>
22         Speed up remove.  Use 'dict[k]=v' as a self-tuning hint.
23         * Dictionary.cs (GetSlot): Move data-structure traversal to ...
24         (GetPrev): ... this.  Returns the slot prior to the place we're
25         looking for, or null if that place is the head of the chain.
26         (Remove): Use it.
27         (this.set): Use it.  Implement move-to-front on set.
29         * Dictionary.cs (ToTKey, ToTValue): New helpers to convert from
30         type 'object'.
31         (IDictionary.this, IDictionary.Add): Use them.
32         (IDictionary.Contains, IDictionary.Remove): If the types don't
33         match, do nothing.
35 2006-01-19  Raja R Harinath  <rharinath@novell.com>
37         Fix to pass new nunit tests.
38         * Dictionary.cs (ShimEnumerator): New class.  Implement the
39         requirement that ((IDictionary) foo).GetEnumerator ().Current has
40         type DictionaryEntry.
41         (IDictionary.GetEnumerator): Use ShimEnumerator.
42         (Enumerator.Current): Now has type KeyValuePair<TKey, TValue>.
43         (Enumerator.MoveNext): Use VerifyState.
44         (Enumerator.VerifyState): Move validation of 'current' field to ...
45         (Enumerator.CurrentSlot): ... this.
46         (Enumerator.Current, Enumerator.IDictionaryEnumerator.Entry):
47         Use CurrentSlot.
48         (CopyTo, ICollection.CopyTo): Use subtle reasoning to replace a
49         '>=' with a '>'.  Don't throw an ArgumentException when
50         index==array.Length && Count==0.
51         (KeyCollection.CopyTo, ValueCollection.CopyTo): Likewise, and thus
52         obviate the need to check (dictionary.Count == 0).
54 2005-12-20  Sebastien Pouliot  <sebastien@ximian.com>
56         * List.cs: Applied Atsushi's patch for Sort (bug 76361) now that the
57         generic versions of Array.Sort are implemented.
59 2005-12-19  Sebastien Pouliot  <sebastien@ximian.com>
61         * Dictionary.cs: Added [Serializable] attribute to both inner 
62         Enumerator struct in Key and Value inner collection classes.
63         * EqualityComparer.cs: Added missing IEqualityComparer interface.
64         * List.cs: Added [Serializable] attribute to both inner Enumerator
65         struct.
67 2005-12-19  Sebastien Pouliot  <sebastien@ximian.com> 
69         * Dictionary.cs: Fixed ICollection.CopyTo to use DictionaryEntry. Fixed
70         Key and Value CopyTo not to throw exception if the dictionary is empty
71         (fix bug #77019).
72         * List.cs: Fix exception reporting to match MS behaviour (2.0 final).
74 2005-11-19  Zoltan Varga  <vargaz@gmail.com>
76         * KeyNotFoundException.cs: Add default message.
78 2005-09-18  Miguel de Icaza  <miguel@novell.com>
80         * Dictionary.cs: Change style for internal fields.
82         If the capacity is zero, set the capacity to our default size as 0
83         is an allowed parameter in .NET
85 2005-08-10  Kamil Skalski  <nazgul@nemerle.org>
87         * KeyValuePair.cs, Dictionary.cs: Change Key and Value to properties to match
88         .NET 2.0 July CTP. Update its use in Dictionary, since now we
89         cannot write to them.
90         
91 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
93         * Comparer.cs, EqualityComparer.cs: Use MakeGenericType instead of BindGenericParameters.
96 2005-06-27  Raja R Harinath  <rharinath@novell.com>
98         Introduce some thread-safety by removing the modify-on-read
99         move-to-front heuristic.
100         * Dictionary.cs (_enumeratorGeneration, _enumerators): Remove.
101         (Count): Add internal property set.  Invalidate enumerators when
102         Count is changed.  Change all references of _usedSlots to Count.
103         (this): Invalidate enumerators when the value of some slot is
104         changed, even if the layout of the data-structure isn't modified.
105         (DoHash): Remove null-key check.  All codepaths leading to this
106         function already have the check.
107         (GetSlot): Remove move-to-front heuristic.
108         (Remove): Update.
110 2005-06-24  Martin Baulig  <martin@ximian.com>
112         * IDictionary.cs: Use the same type parameter names than on MS.
114         * IDictionary.cs, Dictionary.cs: We don't need the `CLSCompliant'
115         attribute here.
117 2005-06-23  Martin Baulig  <martin@ximian.com>
119         * *.cs: Removed the `[ComVisible(false)]' attributes everywhere.
121 2005-06-22  Raja R Harinath  <rharinath@novell.com>
123         * Dictionary.cs (_generation, _enumeratorGeneration, _enumerators):
124         New fields to implement fail-fast semantics.  All code that
125         modifies the table increment _generation.
126         (GetSlot): Use _hcp to compare keys.  Return the slot containing
127         the key, rather than the index.  Avoid move-to-front heuristic
128         when there's an enumerator coursing through the table.
129         (this, Add, TryGetValue, ContainsKey, Remove): Update to change.
130         (Enumerator.Enumerator): Save the generation of the dictionary.
131         (Enumerator.Dispose): Inform dictionary that the enumerator is no more.
132         (Enumerator.MoveNext, Enumerator.VerifyState): Fail if the
133         dictionary has been modified.
135 2005-06-20  David waite  <mass@akuma.org>
137         * List.cs : substantial changes and optimizations
138         (AddCollection, AddEnumerable): new internal specializations of AddRange
139         (AsReadOnly): returns specific IList<T> to match ms.net 2.0b2 api.
140         (Clear): reset size to zero on clear
141         (ConvertAll): catch null converter, use Add to prevent OutOfBounds
142         exception
143         (FindAll, FindIndex, FindLast, FindLastIndex, RemoveAll, TrueForAll): 
144         check for null match
145         (FindLastIndex): correct index parameters based on ms.net 2005b2 behavior
146         (ForEach): catch null action
147         (CheckIndex): new internal function similar to CheckRange for functions
148         which only provide a starting index
149         (InsertCollection, InsertEnumerable): new internal specializations of
150         InsertRange
151         (ReadOnlyList): removed, ReadOnlyCollection in 
152         System.Collections.ObjectModel is used instead now 
153     
154 2005-06-16  David Waite  <mass@akuma.org>
156         * Dictionary.cs (EnumerationMode): Remove.
157         (Enumerator): Remove return type flag - legacy return is expected to
158         always return a DictionaryEntry
159         (Enumerator): Make constructor internal, it is not public on ms.net 
160         beta 2
161         (VerifyState): Added method to check state preconditions and throw
162         appropriate exceptions.
163         (KeyCollection,ValueCollection): Mark sealed to match ms.net beta 2
164         (KeyCollection.Enumerator._hostEnumerator): make exact struct type,
165         rather than boxing and using by interface
166         (KeyCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
167         (ValueCollection.Enumerator._hostEnumerator): make exact struct type,
168         rather than boxing and using by interface
169         (ValueCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
170         * EqualityComparer.cs (DefaultComparer, IEquatableOfTEqualityComparer):
171         Mark as serializable.
173 2005-06-16  Raja R Harinath  <rharinath@novell.com>
175         * Dictionary.cs (GetKeys, GetValues): Remove.
176         (SetThreshold): New function to calculate the resize threshold.
177         (CopyTo): Don't use foreach syntax.
178         (ContainsValue): Likewise.  Use default equality comparer of the
179         value type.
180         (GetObjectData): Use CopyTo to copy into temporary array.  Don't
181         save redundant _usedSlots and _threshold.
182         (OnDeserialization): Rewrite.
183         (ICollection<>.CopyTo): Forward to CopyTo.
184         (Enumerator._nextIndex): Rename to from _index.
185         (Enumerator._next, Enumerator.FixNext): Remove.
186         (Enumerator.Current): Rewrite to avoid need for _next.
187         (Enumerator.IEnumerator.Reset): Update.
188         (KeyCollection): Is also IEnumerable<TKey> and IEnumerable.
189         Update methods to conform to standard.
190         (KeyCollection.GetEnumerator): Restore.  Return the correct type.
191         (KeyCollection.Enumerator): Rename from KeyEnumerator.  Simple
192         wrapper that forwards to Dictionary<,>.Enumerator.
193         (ValueCollection): Likewise.
195 2005-06-12  David Waite  <dwaite@gmail.com>
197         * IKeyComparer.cs: removed
198         * KeyValuePair.cs: add same-style ToString as ms.net Beta2 impl,
199         make Serializable, use correct field names.
200         * Dictionary.cs: Miscelaneus clean-ups, added serialization
201         support, use Hashtable prime functions
203 2005-06-12  Ben Maurer  <bmaurer@ximian.com>
205         * Comparer.cs, EqualityComparer.cs: Important performance hack:
206         make sure that we don't box stuff and do reflection on every
207         comparison. We use reflection at cctor time rather than on every
208         request.
210 2005-06-09  Raja R Harinath  <rharinath@novell.com>
212         Simplify Enumerator.MoveNext to make it "obviously correct", rather
213         than require subtle reasoning about the state of various variables.
214         * Dictionary.cs (Enumerator._isValid): Remove.  Replace all uses
215         with "_current == null".
216         (Enumerator._validNodeVisited): Remove.
217         (Enumerator._next): New.  Holds the the next position.
218         (Enumerator.FixNest): New helper function that ensures that _next
219         has the right value.
220         (Enumerator.MoveNext): Simplify.  Now, copies _next to _current
221         and advances _next if possible.
223 2005-06-08  Martin Baulig  <martin@ximian.com>
225         * Dictionary.cs (Dictionary.KeyEnumerator): Removed the public
226         GetEnumerator() function since it's returning the wrong type.
227         (Dictionary.ValueEnumerator): Likewise.  Fix #75073.
229 2005-06-08  Ankit Jain <ankit@corewars.org>
231         * Dictionary.cs (Dictionary<TKey, TValue>.MoveNext): Allow traversal of chain in last slot
232         of the table. Fixes #75168.
234 2005-06-04  Ben Maurer  <bmaurer@ximian.com>
236         * *.cs: 2.0 api fixups
238 2005-05-26  Miguel de Icaza  <miguel@novell.com>
240         * Dictionary.cs: Remove the `Hash' name from the Dictionary
241         internal classes, make them public.
243 2005-05-26  Zoltan Varga  <vargaz@freemail.hu>
245         * Dictionary.cs: Fix a warning.
247         * IDictionary.cs: Add missing TryGetValue method.
249 2005-05-19  Geoff Norton  <gnorton@customerdna.com>
251         * List.cs (Insert): Resize the array before the shift if needed
253 2005-05-18  Miguel de Icaza  <miguel@novell.com>
255         * List.cs (GetRange): Implement.
257         Do not do lazy loading of data.  Not worth adding an
258         extra check, and not worth the bugs. 
260         This decision wont be discussed until: a) a full List regression
261         test suite exists and  b) performance benchmarks are created.  (b)
262         depends on (a) or the argument wont even be heard. 
264 2005-05-13  Atsushi Enomoto  <atsushi@ximian.com>
266         * Queue.cs, Stack.cs: moved to System.dll
268 2005-05-06  Martin Baulig  <martin@ximian.com>
270         * *.cs: Add CLSCompliant(true) where missing.
272 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
274         * *.cs: Remove CLSCompliant(false) attributes.
276 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
278         * List.cs: Applied patch from Mart Roosmaa (roosmaa@gmail.com). 
279         Fix Insert method. Fixes #74824.
281 2005-04-29  Martin Baulig  <martin@ximian.com>
283         Reflect latest spec changes.
285         * IEnumerable.cs (IEnumerable<T>): Implement IEnumerable.
286         * IEnumerator.cs (IEnumerator<T>): Implement IEnumerator.
288 2005-04-29  Raja R Harinath  <rharinath@novell.com>
290         Remove FIXME.
291         * Dictionary.cs (Slot<K,V>): Move to ...
292         (Dictionary<K,V>.Slot): ... here.
294 2005-04-28  Martin Baulig  <martin@ximian.com>
296         * Dictionary.cs, Queue.cs, Stack.cs, List.cs, Comparer.cs: Don't
297         duplicate type parameters in the nested classes.
299 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
301         * List.cs: Fix ToArray () method. Fixes #74675.
303 2005-04-04  Raja R Harinath  <rharinath@novell.com>
305         * Dictionary.cs: Update to draft of Feb 27.  Add some argument checks.
306         (GetSlot): Don't throw KeyNotFoundException.  Unify all list
307         traversals in here.  Move found key to head of chain, and return
308         the index of the chain suitable for/containing the key.
309         (Item, Add, Remove): Simplify, and remove FIXMEs.
310         (Resize): Reuse linked list nodes from old table.
311         (Dictionary.CopyTo, HashKeyCollection.CopyTo, HashValueCollection.CopyTo):
312         Add some argument checks.
314 2005-04-02  Ben Maurer  <bmaurer@ximian.com>
316         * Dictionary.cs: Real impl.
318 2005-02-21  Martin Baulig  <martin@ximian.com>
320         * IComparer.cs: Reverted the last change here, Equals() and
321         GetHashCode() have been removed a long time ago.
323 2005-02-21  Kazuki Oikawa  <kazuki@panicode.com>
325         * IComparer.cs, IDictionary.cs: Corrected the wrong declaration.
327 2005-02-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
329         * List.cs: Added internal ReadOnlyCollection class,
330         which is a wrapper for a read only IList<T> version of the List<T>.
331         Used in AsReadOnly () method.
332         
333 2005-02-07  Ben Maurer  <bmaurer@ximian.com>
335         * List.cs (CheckRange): Comparison error. Duh!
336         (Shift): really deal with neg. delta. Also, adjust the `size'.
338         Based on a patch from Marc Denty (marc.denty@libertysurf.fr).
340         Fixes #72258.
342 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
344         * Queue.cs: `duh' bugs.
346 2004-12-27  Ben Maurer  <bmaurer@ximian.com>
348         * Stack.cs: Stupid bug fixes.
350         * List.cs: My new (mostly untested ;-) impl of List
351         <T>. Implements most of the API.
353 2004-12-26  Ben Maurer  <bmaurer@ximian.com>
355         * Queue.cs: New, non-linked-list based impl.
357 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
359         * Comparer.cs: Update this class.
361 2004-11-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
363         * List.cs: Enumerator changed to behave like the MS impl.
364         
365 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
367         * Stack.cs: New, list based impl. Waiting for some gmcs fixes.
369 2004-11-10  Martin Baulig  <martin@ximian.com>
371         * IDictionary.cs (IDictionary): `IsReadOnly' and `Clear' are
372         inherited from ICollection.
374 2004-09-20  Gert Driesen <drieseng@users.sourceforge.net>
376         * ReadOnlyCollection.cs: Moved to System assembly
377         * Collection.cs: Moved to System assembly
379 2004-09-07  Carlos Alberto Cortez <carlos@unixmexico.org>
381         * ReadOnlyCollection.cs: New file and changes to 
382         Collection.cs tu support it.
384 2004-09-05  Marek Safar <marek.safar@seznam.cz>
386         * Dictionary.cs: Added new file (no implementation).
388 2004-09-03  Carlos Alberto Cortez <carlos@unixmexico.org>
390         * Collection.cs: Small improvements related to
391         style, resizing, and type checking.
393 2004-09-01  Carlos Alberto Cortez <carlos@unixmexico.org>
395         * Collection.cs: New file.
397 2004-08-04  Martin Baulig  <martin@ximian.com>
399         * List.cs (List<T>.Enumerator): Made this a struct.
400         (List<T>.GetEnumerator): The public method now returns the
401         `Enumerator' struct.
403 2004-08-02  Martin Baulig  <martin@ximian.com>
405         Started to do some API review.
407         * ICollection.cs (ICollection<T>): Added IsReadOnly, Add, Clear,
408         Contains and Remove.
410         * IList.cs (IList<T>): Removed Add, Clear, Constains, Remove,
411         IsReadOnly and IsFixedSize.
413 2004-08-02  Martin Baulig  <martin@ximian.com>
415         * IList.cs (IList.Add): Changed return type to void.
417         * List.cs (List.Add): Likewise.
419 2004-07-16  Martin Baulig  <martin@ximian.com>
421         * IComparable.cs: Removed, it's in System.
423 2004-07-12  Duncan Mak  <duncan@ximian.com>
425         * KeyNotFoundException.cs: Added.
427 2004-06-18  Ben Maurer  <bmaurer@ximian.com>
429         * Comparer.cs: v2 impl. Some workarounds for gmcs are enabled.
431 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
433         * Queue.cs: Fixed possible integer overflow in CopyTo methods.
434         * Stack.cs: Fixed possible integer overflow in CopyTo methods.
436 2004-03-13  Martin Baulig  <martin@ximian.com>
438         * Stack.cs, Queue.cs, List.cs: Implement the non-generic interfaces.
440 2004-03-11  Martin Baulig  <martin@ximian.com>
442         * List.cs: New file.
444 2004-03-11  Martin Baulig  <martin@ximian.com>
446         * Stack.cs, Queue.cs: Just use `Node' for the nested class, not
447         `Node<T>' (which would create another type parameter `T'
448         overriding `T' from the outer class).   
450 2004-02-23  Martin Baulig  <martin@ximian.com>
452         * Stack.cs, Queue.cs: New files.  Hmm, looks like I forgot to add
453         them to CVS; they're already on my hard disk since December or so.
455 2003-12-08  Martin Baulig  <martin@ximian.com>
457         * *.cs: require GENERICS.
459 2003-11-08 Ben Maurer  <bmaurer@users.sourceforge.net>
461         * *.cs: require NET_2_0 and GENERICS
463 2003-11-07 Ben Maurer  <bmaurer@users.sourceforge.net>
465         * IComparable.cs, IComparer.cs, IDictionary.cs, IKeyComparer.cs, KeyValuePair.cs
466         Added.
468 2003-11-06  Martin Baulig  <martin@ximian.com>
470         * ICollection.cs, IList.cs, IEnumerator.cs, IEnumerable.cs:
471         Started to implement the System.Collections.Generic classes.