1 2007-03-08 David Mitchell <dmitchell@logos.com>
3 * List.cs: Fix the case where List.set_Item(int index) throws
4 inappropriate exception when index is equal to List.Count
6 List.IndexOf(object item) and IList.Contains(object item) throw
7 exceptions when given invalid types.
9 IList.Add(object item) throws InvalidCastException when item is
10 not of the correct type.
12 2007-03-08 Gert Driesen <drieseng@users.sourceforge.net>
14 * Comparer.cs: Renamed IComparableOfTComparer<T> to GenericComparer<T>
15 to fix binary serialization compatibility with MS.
17 2007-03-05 David Mitchell <dmitchell@logos.com>
19 * Dictionary.cs: An instance of Dictionary<TKey,TValue> is
20 supposed to throw a KeyNotFoundException when
21 the user attempts to retrieve the value associated with a key that
22 is not in the dictionary.
24 On the other hand, an instance of IDictionary is supposed to
25 return null in similar circumstances.
27 2007-03-05 David Mitchell <dmitchell@logos.com>
29 * List.cs: Fix InsertRange bug (80930).
31 2006-09-15 Gert Driesen <drieseng@users.sourceforge.net>
33 * List.cs: Fixed binary serialization compatibility with MS.NET.
34 Increment version whenever _items is modified; this fixes version
37 2006-09-06 Zoltan Varga <vargaz@gmail.com>
39 * Dictionary.cs: Speed up get_Item/set_Item/GetPrev () a bit. Increase capacity
40 specified by the user so 'capacity' elements can really be added without resizing.
42 2006-07-12 Zoltan Varga <vargaz@gmail.com>
44 * Dictionary.cs: Swap order of parameters to cmp.Equals () to improve
45 compatibility with MS.NET and strange Equals () implementations.
47 2006-05-17 Kazuki Oikawa <kazuki@panicode.com>
49 * List.cs : implemented Sort(Comparison <T>).
51 2006-05-08 Atsushi Enomoto <atsushi@ximian.com>
53 * List.cs : use proper comparer in Contains(), IndexOf() and
54 LastIndexOf(). Patch by Kazuki Oikawa. Fixed bug #77277.
56 2006-03-16 Ankit Jain <jankit@novell.com>
58 * List.cs (CheckIndex): Check for -ve indices and allow index == size.
59 (Insert): Use CheckIndex.
61 2006-03-12 Zoltan Varga <vargaz@gmail.com>
63 * List.cs: Applied patch from <kazuki@panicode.com>. Fixes #77504.
65 2006-02-10 Martin Baulig <martin@ximian.com>
68 (IComparableOfTComparer): `T' must implement `IComparable<T>' and
71 Tue Jan 24 18:22:54 CET 2006 Paolo Molaro <lupus@ximian.com>
73 * Dictionary.cs: avoid long reminder operations.
75 2006-01-23 Raja R Harinath <rharinath@novell.com>
77 Speed up remove. Use 'dict[k]=v' as a self-tuning hint.
78 * Dictionary.cs (GetSlot): Move data-structure traversal to ...
79 (GetPrev): ... this. Returns the slot prior to the place we're
80 looking for, or null if that place is the head of the chain.
82 (this.set): Use it. Implement move-to-front on set.
84 * Dictionary.cs (ToTKey, ToTValue): New helpers to convert from
86 (IDictionary.this, IDictionary.Add): Use them.
87 (IDictionary.Contains, IDictionary.Remove): If the types don't
90 2006-01-19 Raja R Harinath <rharinath@novell.com>
92 Fix to pass new nunit tests.
93 * Dictionary.cs (ShimEnumerator): New class. Implement the
94 requirement that ((IDictionary) foo).GetEnumerator ().Current has
96 (IDictionary.GetEnumerator): Use ShimEnumerator.
97 (Enumerator.Current): Now has type KeyValuePair<TKey, TValue>.
98 (Enumerator.MoveNext): Use VerifyState.
99 (Enumerator.VerifyState): Move validation of 'current' field to ...
100 (Enumerator.CurrentSlot): ... this.
101 (Enumerator.Current, Enumerator.IDictionaryEnumerator.Entry):
103 (CopyTo, ICollection.CopyTo): Use subtle reasoning to replace a
104 '>=' with a '>'. Don't throw an ArgumentException when
105 index==array.Length && Count==0.
106 (KeyCollection.CopyTo, ValueCollection.CopyTo): Likewise, and thus
107 obviate the need to check (dictionary.Count == 0).
109 2005-12-20 Sebastien Pouliot <sebastien@ximian.com>
111 * List.cs: Applied Atsushi's patch for Sort (bug 76361) now that the
112 generic versions of Array.Sort are implemented.
114 2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
116 * Dictionary.cs: Added [Serializable] attribute to both inner
117 Enumerator struct in Key and Value inner collection classes.
118 * EqualityComparer.cs: Added missing IEqualityComparer interface.
119 * List.cs: Added [Serializable] attribute to both inner Enumerator
122 2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
124 * Dictionary.cs: Fixed ICollection.CopyTo to use DictionaryEntry. Fixed
125 Key and Value CopyTo not to throw exception if the dictionary is empty
127 * List.cs: Fix exception reporting to match MS behaviour (2.0 final).
129 2005-11-19 Zoltan Varga <vargaz@gmail.com>
131 * KeyNotFoundException.cs: Add default message.
133 2005-09-18 Miguel de Icaza <miguel@novell.com>
135 * Dictionary.cs: Change style for internal fields.
137 If the capacity is zero, set the capacity to our default size as 0
138 is an allowed parameter in .NET
140 2005-08-10 Kamil Skalski <nazgul@nemerle.org>
142 * KeyValuePair.cs, Dictionary.cs: Change Key and Value to properties to match
143 .NET 2.0 July CTP. Update its use in Dictionary, since now we
144 cannot write to them.
146 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
148 * Comparer.cs, EqualityComparer.cs: Use MakeGenericType instead of BindGenericParameters.
151 2005-06-27 Raja R Harinath <rharinath@novell.com>
153 Introduce some thread-safety by removing the modify-on-read
154 move-to-front heuristic.
155 * Dictionary.cs (_enumeratorGeneration, _enumerators): Remove.
156 (Count): Add internal property set. Invalidate enumerators when
157 Count is changed. Change all references of _usedSlots to Count.
158 (this): Invalidate enumerators when the value of some slot is
159 changed, even if the layout of the data-structure isn't modified.
160 (DoHash): Remove null-key check. All codepaths leading to this
161 function already have the check.
162 (GetSlot): Remove move-to-front heuristic.
165 2005-06-24 Martin Baulig <martin@ximian.com>
167 * IDictionary.cs: Use the same type parameter names than on MS.
169 * IDictionary.cs, Dictionary.cs: We don't need the `CLSCompliant'
172 2005-06-23 Martin Baulig <martin@ximian.com>
174 * *.cs: Removed the `[ComVisible(false)]' attributes everywhere.
176 2005-06-22 Raja R Harinath <rharinath@novell.com>
178 * Dictionary.cs (_generation, _enumeratorGeneration, _enumerators):
179 New fields to implement fail-fast semantics. All code that
180 modifies the table increment _generation.
181 (GetSlot): Use _hcp to compare keys. Return the slot containing
182 the key, rather than the index. Avoid move-to-front heuristic
183 when there's an enumerator coursing through the table.
184 (this, Add, TryGetValue, ContainsKey, Remove): Update to change.
185 (Enumerator.Enumerator): Save the generation of the dictionary.
186 (Enumerator.Dispose): Inform dictionary that the enumerator is no more.
187 (Enumerator.MoveNext, Enumerator.VerifyState): Fail if the
188 dictionary has been modified.
190 2005-06-20 David waite <mass@akuma.org>
192 * List.cs : substantial changes and optimizations
193 (AddCollection, AddEnumerable): new internal specializations of AddRange
194 (AsReadOnly): returns specific IList<T> to match ms.net 2.0b2 api.
195 (Clear): reset size to zero on clear
196 (ConvertAll): catch null converter, use Add to prevent OutOfBounds
198 (FindAll, FindIndex, FindLast, FindLastIndex, RemoveAll, TrueForAll):
200 (FindLastIndex): correct index parameters based on ms.net 2005b2 behavior
201 (ForEach): catch null action
202 (CheckIndex): new internal function similar to CheckRange for functions
203 which only provide a starting index
204 (InsertCollection, InsertEnumerable): new internal specializations of
206 (ReadOnlyList): removed, ReadOnlyCollection in
207 System.Collections.ObjectModel is used instead now
209 2005-06-16 David Waite <mass@akuma.org>
211 * Dictionary.cs (EnumerationMode): Remove.
212 (Enumerator): Remove return type flag - legacy return is expected to
213 always return a DictionaryEntry
214 (Enumerator): Make constructor internal, it is not public on ms.net
216 (VerifyState): Added method to check state preconditions and throw
217 appropriate exceptions.
218 (KeyCollection,ValueCollection): Mark sealed to match ms.net beta 2
219 (KeyCollection.Enumerator._hostEnumerator): make exact struct type,
220 rather than boxing and using by interface
221 (KeyCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
222 (ValueCollection.Enumerator._hostEnumerator): make exact struct type,
223 rather than boxing and using by interface
224 (ValueCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
225 * EqualityComparer.cs (DefaultComparer, IEquatableOfTEqualityComparer):
226 Mark as serializable.
228 2005-06-16 Raja R Harinath <rharinath@novell.com>
230 * Dictionary.cs (GetKeys, GetValues): Remove.
231 (SetThreshold): New function to calculate the resize threshold.
232 (CopyTo): Don't use foreach syntax.
233 (ContainsValue): Likewise. Use default equality comparer of the
235 (GetObjectData): Use CopyTo to copy into temporary array. Don't
236 save redundant _usedSlots and _threshold.
237 (OnDeserialization): Rewrite.
238 (ICollection<>.CopyTo): Forward to CopyTo.
239 (Enumerator._nextIndex): Rename to from _index.
240 (Enumerator._next, Enumerator.FixNext): Remove.
241 (Enumerator.Current): Rewrite to avoid need for _next.
242 (Enumerator.IEnumerator.Reset): Update.
243 (KeyCollection): Is also IEnumerable<TKey> and IEnumerable.
244 Update methods to conform to standard.
245 (KeyCollection.GetEnumerator): Restore. Return the correct type.
246 (KeyCollection.Enumerator): Rename from KeyEnumerator. Simple
247 wrapper that forwards to Dictionary<,>.Enumerator.
248 (ValueCollection): Likewise.
250 2005-06-12 David Waite <dwaite@gmail.com>
252 * IKeyComparer.cs: removed
253 * KeyValuePair.cs: add same-style ToString as ms.net Beta2 impl,
254 make Serializable, use correct field names.
255 * Dictionary.cs: Miscelaneus clean-ups, added serialization
256 support, use Hashtable prime functions
258 2005-06-12 Ben Maurer <bmaurer@ximian.com>
260 * Comparer.cs, EqualityComparer.cs: Important performance hack:
261 make sure that we don't box stuff and do reflection on every
262 comparison. We use reflection at cctor time rather than on every
265 2005-06-09 Raja R Harinath <rharinath@novell.com>
267 Simplify Enumerator.MoveNext to make it "obviously correct", rather
268 than require subtle reasoning about the state of various variables.
269 * Dictionary.cs (Enumerator._isValid): Remove. Replace all uses
270 with "_current == null".
271 (Enumerator._validNodeVisited): Remove.
272 (Enumerator._next): New. Holds the the next position.
273 (Enumerator.FixNest): New helper function that ensures that _next
275 (Enumerator.MoveNext): Simplify. Now, copies _next to _current
276 and advances _next if possible.
278 2005-06-08 Martin Baulig <martin@ximian.com>
280 * Dictionary.cs (Dictionary.KeyEnumerator): Removed the public
281 GetEnumerator() function since it's returning the wrong type.
282 (Dictionary.ValueEnumerator): Likewise. Fix #75073.
284 2005-06-08 Ankit Jain <ankit@corewars.org>
286 * Dictionary.cs (Dictionary<TKey, TValue>.MoveNext): Allow traversal of chain in last slot
287 of the table. Fixes #75168.
289 2005-06-04 Ben Maurer <bmaurer@ximian.com>
291 * *.cs: 2.0 api fixups
293 2005-05-26 Miguel de Icaza <miguel@novell.com>
295 * Dictionary.cs: Remove the `Hash' name from the Dictionary
296 internal classes, make them public.
298 2005-05-26 Zoltan Varga <vargaz@freemail.hu>
300 * Dictionary.cs: Fix a warning.
302 * IDictionary.cs: Add missing TryGetValue method.
304 2005-05-19 Geoff Norton <gnorton@customerdna.com>
306 * List.cs (Insert): Resize the array before the shift if needed
308 2005-05-18 Miguel de Icaza <miguel@novell.com>
310 * List.cs (GetRange): Implement.
312 Do not do lazy loading of data. Not worth adding an
313 extra check, and not worth the bugs.
315 This decision wont be discussed until: a) a full List regression
316 test suite exists and b) performance benchmarks are created. (b)
317 depends on (a) or the argument wont even be heard.
319 2005-05-13 Atsushi Enomoto <atsushi@ximian.com>
321 * Queue.cs, Stack.cs: moved to System.dll
323 2005-05-06 Martin Baulig <martin@ximian.com>
325 * *.cs: Add CLSCompliant(true) where missing.
327 2005-05-06 Zoltan Varga <vargaz@freemail.hu>
329 * *.cs: Remove CLSCompliant(false) attributes.
331 2005-05-05 Zoltan Varga <vargaz@freemail.hu>
333 * List.cs: Applied patch from Mart Roosmaa (roosmaa@gmail.com).
334 Fix Insert method. Fixes #74824.
336 2005-04-29 Martin Baulig <martin@ximian.com>
338 Reflect latest spec changes.
340 * IEnumerable.cs (IEnumerable<T>): Implement IEnumerable.
341 * IEnumerator.cs (IEnumerator<T>): Implement IEnumerator.
343 2005-04-29 Raja R Harinath <rharinath@novell.com>
346 * Dictionary.cs (Slot<K,V>): Move to ...
347 (Dictionary<K,V>.Slot): ... here.
349 2005-04-28 Martin Baulig <martin@ximian.com>
351 * Dictionary.cs, Queue.cs, Stack.cs, List.cs, Comparer.cs: Don't
352 duplicate type parameters in the nested classes.
354 2005-04-20 Zoltan Varga <vargaz@freemail.hu>
356 * List.cs: Fix ToArray () method. Fixes #74675.
358 2005-04-04 Raja R Harinath <rharinath@novell.com>
360 * Dictionary.cs: Update to draft of Feb 27. Add some argument checks.
361 (GetSlot): Don't throw KeyNotFoundException. Unify all list
362 traversals in here. Move found key to head of chain, and return
363 the index of the chain suitable for/containing the key.
364 (Item, Add, Remove): Simplify, and remove FIXMEs.
365 (Resize): Reuse linked list nodes from old table.
366 (Dictionary.CopyTo, HashKeyCollection.CopyTo, HashValueCollection.CopyTo):
367 Add some argument checks.
369 2005-04-02 Ben Maurer <bmaurer@ximian.com>
371 * Dictionary.cs: Real impl.
373 2005-02-21 Martin Baulig <martin@ximian.com>
375 * IComparer.cs: Reverted the last change here, Equals() and
376 GetHashCode() have been removed a long time ago.
378 2005-02-21 Kazuki Oikawa <kazuki@panicode.com>
380 * IComparer.cs, IDictionary.cs: Corrected the wrong declaration.
382 2005-02-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
384 * List.cs: Added internal ReadOnlyCollection class,
385 which is a wrapper for a read only IList<T> version of the List<T>.
386 Used in AsReadOnly () method.
388 2005-02-07 Ben Maurer <bmaurer@ximian.com>
390 * List.cs (CheckRange): Comparison error. Duh!
391 (Shift): really deal with neg. delta. Also, adjust the `size'.
393 Based on a patch from Marc Denty (marc.denty@libertysurf.fr).
397 2005-01-29 Ben Maurer <bmaurer@ximian.com>
399 * Queue.cs: `duh' bugs.
401 2004-12-27 Ben Maurer <bmaurer@ximian.com>
403 * Stack.cs: Stupid bug fixes.
405 * List.cs: My new (mostly untested ;-) impl of List
406 <T>. Implements most of the API.
408 2004-12-26 Ben Maurer <bmaurer@ximian.com>
410 * Queue.cs: New, non-linked-list based impl.
412 2004-11-29 Ben Maurer <bmaurer@ximian.com>
414 * Comparer.cs: Update this class.
416 2004-11-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
418 * List.cs: Enumerator changed to behave like the MS impl.
420 2004-11-25 Ben Maurer <bmaurer@ximian.com>
422 * Stack.cs: New, list based impl. Waiting for some gmcs fixes.
424 2004-11-10 Martin Baulig <martin@ximian.com>
426 * IDictionary.cs (IDictionary): `IsReadOnly' and `Clear' are
427 inherited from ICollection.
429 2004-09-20 Gert Driesen <drieseng@users.sourceforge.net>
431 * ReadOnlyCollection.cs: Moved to System assembly
432 * Collection.cs: Moved to System assembly
434 2004-09-07 Carlos Alberto Cortez <carlos@unixmexico.org>
436 * ReadOnlyCollection.cs: New file and changes to
437 Collection.cs tu support it.
439 2004-09-05 Marek Safar <marek.safar@seznam.cz>
441 * Dictionary.cs: Added new file (no implementation).
443 2004-09-03 Carlos Alberto Cortez <carlos@unixmexico.org>
445 * Collection.cs: Small improvements related to
446 style, resizing, and type checking.
448 2004-09-01 Carlos Alberto Cortez <carlos@unixmexico.org>
450 * Collection.cs: New file.
452 2004-08-04 Martin Baulig <martin@ximian.com>
454 * List.cs (List<T>.Enumerator): Made this a struct.
455 (List<T>.GetEnumerator): The public method now returns the
458 2004-08-02 Martin Baulig <martin@ximian.com>
460 Started to do some API review.
462 * ICollection.cs (ICollection<T>): Added IsReadOnly, Add, Clear,
465 * IList.cs (IList<T>): Removed Add, Clear, Constains, Remove,
466 IsReadOnly and IsFixedSize.
468 2004-08-02 Martin Baulig <martin@ximian.com>
470 * IList.cs (IList.Add): Changed return type to void.
472 * List.cs (List.Add): Likewise.
474 2004-07-16 Martin Baulig <martin@ximian.com>
476 * IComparable.cs: Removed, it's in System.
478 2004-07-12 Duncan Mak <duncan@ximian.com>
480 * KeyNotFoundException.cs: Added.
482 2004-06-18 Ben Maurer <bmaurer@ximian.com>
484 * Comparer.cs: v2 impl. Some workarounds for gmcs are enabled.
486 2004-05-26 Sebastien Pouliot <sebastien@ximian.com>
488 * Queue.cs: Fixed possible integer overflow in CopyTo methods.
489 * Stack.cs: Fixed possible integer overflow in CopyTo methods.
491 2004-03-13 Martin Baulig <martin@ximian.com>
493 * Stack.cs, Queue.cs, List.cs: Implement the non-generic interfaces.
495 2004-03-11 Martin Baulig <martin@ximian.com>
499 2004-03-11 Martin Baulig <martin@ximian.com>
501 * Stack.cs, Queue.cs: Just use `Node' for the nested class, not
502 `Node<T>' (which would create another type parameter `T'
503 overriding `T' from the outer class).
505 2004-02-23 Martin Baulig <martin@ximian.com>
507 * Stack.cs, Queue.cs: New files. Hmm, looks like I forgot to add
508 them to CVS; they're already on my hard disk since December or so.
510 2003-12-08 Martin Baulig <martin@ximian.com>
512 * *.cs: require GENERICS.
514 2003-11-08 Ben Maurer <bmaurer@users.sourceforge.net>
516 * *.cs: require NET_2_0 and GENERICS
518 2003-11-07 Ben Maurer <bmaurer@users.sourceforge.net>
520 * IComparable.cs, IComparer.cs, IDictionary.cs, IKeyComparer.cs, KeyValuePair.cs
523 2003-11-06 Martin Baulig <martin@ximian.com>
525 * ICollection.cs, IList.cs, IEnumerator.cs, IEnumerable.cs:
526 Started to implement the System.Collections.Generic classes.