1 2006-09-15 Gert Driesen <drieseng@users.sourceforge.net>
3 * List.cs: Fixed binary serialization compatibility with MS.NET.
4 Increment version whenever _items is modified; this fixes version
7 2006-09-06 Zoltan Varga <vargaz@gmail.com>
9 * Dictionary.cs: Speed up get_Item/set_Item/GetPrev () a bit. Increase capacity
10 specified by the user so 'capacity' elements can really be added without resizing.
12 2006-07-12 Zoltan Varga <vargaz@gmail.com>
14 * Dictionary.cs: Swap order of parameters to cmp.Equals () to improve
15 compatibility with MS.NET and strange Equals () implementations.
17 2006-05-17 Kazuki Oikawa <kazuki@panicode.com>
19 * List.cs : implemented Sort(Comparison <T>).
21 2006-05-08 Atsushi Enomoto <atsushi@ximian.com>
23 * List.cs : use proper comparer in Contains(), IndexOf() and
24 LastIndexOf(). Patch by Kazuki Oikawa. Fixed bug #77277.
26 2006-03-16 Ankit Jain <jankit@novell.com>
28 * List.cs (CheckIndex): Check for -ve indices and allow index == size.
29 (Insert): Use CheckIndex.
31 2006-03-12 Zoltan Varga <vargaz@gmail.com>
33 * List.cs: Applied patch from <kazuki@panicode.com>. Fixes #77504.
35 2006-02-10 Martin Baulig <martin@ximian.com>
38 (IComparableOfTComparer): `T' must implement `IComparable<T>' and
41 Tue Jan 24 18:22:54 CET 2006 Paolo Molaro <lupus@ximian.com>
43 * Dictionary.cs: avoid long reminder operations.
45 2006-01-23 Raja R Harinath <rharinath@novell.com>
47 Speed up remove. Use 'dict[k]=v' as a self-tuning hint.
48 * Dictionary.cs (GetSlot): Move data-structure traversal to ...
49 (GetPrev): ... this. Returns the slot prior to the place we're
50 looking for, or null if that place is the head of the chain.
52 (this.set): Use it. Implement move-to-front on set.
54 * Dictionary.cs (ToTKey, ToTValue): New helpers to convert from
56 (IDictionary.this, IDictionary.Add): Use them.
57 (IDictionary.Contains, IDictionary.Remove): If the types don't
60 2006-01-19 Raja R Harinath <rharinath@novell.com>
62 Fix to pass new nunit tests.
63 * Dictionary.cs (ShimEnumerator): New class. Implement the
64 requirement that ((IDictionary) foo).GetEnumerator ().Current has
66 (IDictionary.GetEnumerator): Use ShimEnumerator.
67 (Enumerator.Current): Now has type KeyValuePair<TKey, TValue>.
68 (Enumerator.MoveNext): Use VerifyState.
69 (Enumerator.VerifyState): Move validation of 'current' field to ...
70 (Enumerator.CurrentSlot): ... this.
71 (Enumerator.Current, Enumerator.IDictionaryEnumerator.Entry):
73 (CopyTo, ICollection.CopyTo): Use subtle reasoning to replace a
74 '>=' with a '>'. Don't throw an ArgumentException when
75 index==array.Length && Count==0.
76 (KeyCollection.CopyTo, ValueCollection.CopyTo): Likewise, and thus
77 obviate the need to check (dictionary.Count == 0).
79 2005-12-20 Sebastien Pouliot <sebastien@ximian.com>
81 * List.cs: Applied Atsushi's patch for Sort (bug 76361) now that the
82 generic versions of Array.Sort are implemented.
84 2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
86 * Dictionary.cs: Added [Serializable] attribute to both inner
87 Enumerator struct in Key and Value inner collection classes.
88 * EqualityComparer.cs: Added missing IEqualityComparer interface.
89 * List.cs: Added [Serializable] attribute to both inner Enumerator
92 2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
94 * Dictionary.cs: Fixed ICollection.CopyTo to use DictionaryEntry. Fixed
95 Key and Value CopyTo not to throw exception if the dictionary is empty
97 * List.cs: Fix exception reporting to match MS behaviour (2.0 final).
99 2005-11-19 Zoltan Varga <vargaz@gmail.com>
101 * KeyNotFoundException.cs: Add default message.
103 2005-09-18 Miguel de Icaza <miguel@novell.com>
105 * Dictionary.cs: Change style for internal fields.
107 If the capacity is zero, set the capacity to our default size as 0
108 is an allowed parameter in .NET
110 2005-08-10 Kamil Skalski <nazgul@nemerle.org>
112 * KeyValuePair.cs, Dictionary.cs: Change Key and Value to properties to match
113 .NET 2.0 July CTP. Update its use in Dictionary, since now we
114 cannot write to them.
116 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
118 * Comparer.cs, EqualityComparer.cs: Use MakeGenericType instead of BindGenericParameters.
121 2005-06-27 Raja R Harinath <rharinath@novell.com>
123 Introduce some thread-safety by removing the modify-on-read
124 move-to-front heuristic.
125 * Dictionary.cs (_enumeratorGeneration, _enumerators): Remove.
126 (Count): Add internal property set. Invalidate enumerators when
127 Count is changed. Change all references of _usedSlots to Count.
128 (this): Invalidate enumerators when the value of some slot is
129 changed, even if the layout of the data-structure isn't modified.
130 (DoHash): Remove null-key check. All codepaths leading to this
131 function already have the check.
132 (GetSlot): Remove move-to-front heuristic.
135 2005-06-24 Martin Baulig <martin@ximian.com>
137 * IDictionary.cs: Use the same type parameter names than on MS.
139 * IDictionary.cs, Dictionary.cs: We don't need the `CLSCompliant'
142 2005-06-23 Martin Baulig <martin@ximian.com>
144 * *.cs: Removed the `[ComVisible(false)]' attributes everywhere.
146 2005-06-22 Raja R Harinath <rharinath@novell.com>
148 * Dictionary.cs (_generation, _enumeratorGeneration, _enumerators):
149 New fields to implement fail-fast semantics. All code that
150 modifies the table increment _generation.
151 (GetSlot): Use _hcp to compare keys. Return the slot containing
152 the key, rather than the index. Avoid move-to-front heuristic
153 when there's an enumerator coursing through the table.
154 (this, Add, TryGetValue, ContainsKey, Remove): Update to change.
155 (Enumerator.Enumerator): Save the generation of the dictionary.
156 (Enumerator.Dispose): Inform dictionary that the enumerator is no more.
157 (Enumerator.MoveNext, Enumerator.VerifyState): Fail if the
158 dictionary has been modified.
160 2005-06-20 David waite <mass@akuma.org>
162 * List.cs : substantial changes and optimizations
163 (AddCollection, AddEnumerable): new internal specializations of AddRange
164 (AsReadOnly): returns specific IList<T> to match ms.net 2.0b2 api.
165 (Clear): reset size to zero on clear
166 (ConvertAll): catch null converter, use Add to prevent OutOfBounds
168 (FindAll, FindIndex, FindLast, FindLastIndex, RemoveAll, TrueForAll):
170 (FindLastIndex): correct index parameters based on ms.net 2005b2 behavior
171 (ForEach): catch null action
172 (CheckIndex): new internal function similar to CheckRange for functions
173 which only provide a starting index
174 (InsertCollection, InsertEnumerable): new internal specializations of
176 (ReadOnlyList): removed, ReadOnlyCollection in
177 System.Collections.ObjectModel is used instead now
179 2005-06-16 David Waite <mass@akuma.org>
181 * Dictionary.cs (EnumerationMode): Remove.
182 (Enumerator): Remove return type flag - legacy return is expected to
183 always return a DictionaryEntry
184 (Enumerator): Make constructor internal, it is not public on ms.net
186 (VerifyState): Added method to check state preconditions and throw
187 appropriate exceptions.
188 (KeyCollection,ValueCollection): Mark sealed to match ms.net beta 2
189 (KeyCollection.Enumerator._hostEnumerator): make exact struct type,
190 rather than boxing and using by interface
191 (KeyCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
192 (ValueCollection.Enumerator._hostEnumerator): make exact struct type,
193 rather than boxing and using by interface
194 (ValueCollection.Enumerator.Dispose): Call _hostEnumerator.Dispose.
195 * EqualityComparer.cs (DefaultComparer, IEquatableOfTEqualityComparer):
196 Mark as serializable.
198 2005-06-16 Raja R Harinath <rharinath@novell.com>
200 * Dictionary.cs (GetKeys, GetValues): Remove.
201 (SetThreshold): New function to calculate the resize threshold.
202 (CopyTo): Don't use foreach syntax.
203 (ContainsValue): Likewise. Use default equality comparer of the
205 (GetObjectData): Use CopyTo to copy into temporary array. Don't
206 save redundant _usedSlots and _threshold.
207 (OnDeserialization): Rewrite.
208 (ICollection<>.CopyTo): Forward to CopyTo.
209 (Enumerator._nextIndex): Rename to from _index.
210 (Enumerator._next, Enumerator.FixNext): Remove.
211 (Enumerator.Current): Rewrite to avoid need for _next.
212 (Enumerator.IEnumerator.Reset): Update.
213 (KeyCollection): Is also IEnumerable<TKey> and IEnumerable.
214 Update methods to conform to standard.
215 (KeyCollection.GetEnumerator): Restore. Return the correct type.
216 (KeyCollection.Enumerator): Rename from KeyEnumerator. Simple
217 wrapper that forwards to Dictionary<,>.Enumerator.
218 (ValueCollection): Likewise.
220 2005-06-12 David Waite <dwaite@gmail.com>
222 * IKeyComparer.cs: removed
223 * KeyValuePair.cs: add same-style ToString as ms.net Beta2 impl,
224 make Serializable, use correct field names.
225 * Dictionary.cs: Miscelaneus clean-ups, added serialization
226 support, use Hashtable prime functions
228 2005-06-12 Ben Maurer <bmaurer@ximian.com>
230 * Comparer.cs, EqualityComparer.cs: Important performance hack:
231 make sure that we don't box stuff and do reflection on every
232 comparison. We use reflection at cctor time rather than on every
235 2005-06-09 Raja R Harinath <rharinath@novell.com>
237 Simplify Enumerator.MoveNext to make it "obviously correct", rather
238 than require subtle reasoning about the state of various variables.
239 * Dictionary.cs (Enumerator._isValid): Remove. Replace all uses
240 with "_current == null".
241 (Enumerator._validNodeVisited): Remove.
242 (Enumerator._next): New. Holds the the next position.
243 (Enumerator.FixNest): New helper function that ensures that _next
245 (Enumerator.MoveNext): Simplify. Now, copies _next to _current
246 and advances _next if possible.
248 2005-06-08 Martin Baulig <martin@ximian.com>
250 * Dictionary.cs (Dictionary.KeyEnumerator): Removed the public
251 GetEnumerator() function since it's returning the wrong type.
252 (Dictionary.ValueEnumerator): Likewise. Fix #75073.
254 2005-06-08 Ankit Jain <ankit@corewars.org>
256 * Dictionary.cs (Dictionary<TKey, TValue>.MoveNext): Allow traversal of chain in last slot
257 of the table. Fixes #75168.
259 2005-06-04 Ben Maurer <bmaurer@ximian.com>
261 * *.cs: 2.0 api fixups
263 2005-05-26 Miguel de Icaza <miguel@novell.com>
265 * Dictionary.cs: Remove the `Hash' name from the Dictionary
266 internal classes, make them public.
268 2005-05-26 Zoltan Varga <vargaz@freemail.hu>
270 * Dictionary.cs: Fix a warning.
272 * IDictionary.cs: Add missing TryGetValue method.
274 2005-05-19 Geoff Norton <gnorton@customerdna.com>
276 * List.cs (Insert): Resize the array before the shift if needed
278 2005-05-18 Miguel de Icaza <miguel@novell.com>
280 * List.cs (GetRange): Implement.
282 Do not do lazy loading of data. Not worth adding an
283 extra check, and not worth the bugs.
285 This decision wont be discussed until: a) a full List regression
286 test suite exists and b) performance benchmarks are created. (b)
287 depends on (a) or the argument wont even be heard.
289 2005-05-13 Atsushi Enomoto <atsushi@ximian.com>
291 * Queue.cs, Stack.cs: moved to System.dll
293 2005-05-06 Martin Baulig <martin@ximian.com>
295 * *.cs: Add CLSCompliant(true) where missing.
297 2005-05-06 Zoltan Varga <vargaz@freemail.hu>
299 * *.cs: Remove CLSCompliant(false) attributes.
301 2005-05-05 Zoltan Varga <vargaz@freemail.hu>
303 * List.cs: Applied patch from Mart Roosmaa (roosmaa@gmail.com).
304 Fix Insert method. Fixes #74824.
306 2005-04-29 Martin Baulig <martin@ximian.com>
308 Reflect latest spec changes.
310 * IEnumerable.cs (IEnumerable<T>): Implement IEnumerable.
311 * IEnumerator.cs (IEnumerator<T>): Implement IEnumerator.
313 2005-04-29 Raja R Harinath <rharinath@novell.com>
316 * Dictionary.cs (Slot<K,V>): Move to ...
317 (Dictionary<K,V>.Slot): ... here.
319 2005-04-28 Martin Baulig <martin@ximian.com>
321 * Dictionary.cs, Queue.cs, Stack.cs, List.cs, Comparer.cs: Don't
322 duplicate type parameters in the nested classes.
324 2005-04-20 Zoltan Varga <vargaz@freemail.hu>
326 * List.cs: Fix ToArray () method. Fixes #74675.
328 2005-04-04 Raja R Harinath <rharinath@novell.com>
330 * Dictionary.cs: Update to draft of Feb 27. Add some argument checks.
331 (GetSlot): Don't throw KeyNotFoundException. Unify all list
332 traversals in here. Move found key to head of chain, and return
333 the index of the chain suitable for/containing the key.
334 (Item, Add, Remove): Simplify, and remove FIXMEs.
335 (Resize): Reuse linked list nodes from old table.
336 (Dictionary.CopyTo, HashKeyCollection.CopyTo, HashValueCollection.CopyTo):
337 Add some argument checks.
339 2005-04-02 Ben Maurer <bmaurer@ximian.com>
341 * Dictionary.cs: Real impl.
343 2005-02-21 Martin Baulig <martin@ximian.com>
345 * IComparer.cs: Reverted the last change here, Equals() and
346 GetHashCode() have been removed a long time ago.
348 2005-02-21 Kazuki Oikawa <kazuki@panicode.com>
350 * IComparer.cs, IDictionary.cs: Corrected the wrong declaration.
352 2005-02-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
354 * List.cs: Added internal ReadOnlyCollection class,
355 which is a wrapper for a read only IList<T> version of the List<T>.
356 Used in AsReadOnly () method.
358 2005-02-07 Ben Maurer <bmaurer@ximian.com>
360 * List.cs (CheckRange): Comparison error. Duh!
361 (Shift): really deal with neg. delta. Also, adjust the `size'.
363 Based on a patch from Marc Denty (marc.denty@libertysurf.fr).
367 2005-01-29 Ben Maurer <bmaurer@ximian.com>
369 * Queue.cs: `duh' bugs.
371 2004-12-27 Ben Maurer <bmaurer@ximian.com>
373 * Stack.cs: Stupid bug fixes.
375 * List.cs: My new (mostly untested ;-) impl of List
376 <T>. Implements most of the API.
378 2004-12-26 Ben Maurer <bmaurer@ximian.com>
380 * Queue.cs: New, non-linked-list based impl.
382 2004-11-29 Ben Maurer <bmaurer@ximian.com>
384 * Comparer.cs: Update this class.
386 2004-11-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
388 * List.cs: Enumerator changed to behave like the MS impl.
390 2004-11-25 Ben Maurer <bmaurer@ximian.com>
392 * Stack.cs: New, list based impl. Waiting for some gmcs fixes.
394 2004-11-10 Martin Baulig <martin@ximian.com>
396 * IDictionary.cs (IDictionary): `IsReadOnly' and `Clear' are
397 inherited from ICollection.
399 2004-09-20 Gert Driesen <drieseng@users.sourceforge.net>
401 * ReadOnlyCollection.cs: Moved to System assembly
402 * Collection.cs: Moved to System assembly
404 2004-09-07 Carlos Alberto Cortez <carlos@unixmexico.org>
406 * ReadOnlyCollection.cs: New file and changes to
407 Collection.cs tu support it.
409 2004-09-05 Marek Safar <marek.safar@seznam.cz>
411 * Dictionary.cs: Added new file (no implementation).
413 2004-09-03 Carlos Alberto Cortez <carlos@unixmexico.org>
415 * Collection.cs: Small improvements related to
416 style, resizing, and type checking.
418 2004-09-01 Carlos Alberto Cortez <carlos@unixmexico.org>
420 * Collection.cs: New file.
422 2004-08-04 Martin Baulig <martin@ximian.com>
424 * List.cs (List<T>.Enumerator): Made this a struct.
425 (List<T>.GetEnumerator): The public method now returns the
428 2004-08-02 Martin Baulig <martin@ximian.com>
430 Started to do some API review.
432 * ICollection.cs (ICollection<T>): Added IsReadOnly, Add, Clear,
435 * IList.cs (IList<T>): Removed Add, Clear, Constains, Remove,
436 IsReadOnly and IsFixedSize.
438 2004-08-02 Martin Baulig <martin@ximian.com>
440 * IList.cs (IList.Add): Changed return type to void.
442 * List.cs (List.Add): Likewise.
444 2004-07-16 Martin Baulig <martin@ximian.com>
446 * IComparable.cs: Removed, it's in System.
448 2004-07-12 Duncan Mak <duncan@ximian.com>
450 * KeyNotFoundException.cs: Added.
452 2004-06-18 Ben Maurer <bmaurer@ximian.com>
454 * Comparer.cs: v2 impl. Some workarounds for gmcs are enabled.
456 2004-05-26 Sebastien Pouliot <sebastien@ximian.com>
458 * Queue.cs: Fixed possible integer overflow in CopyTo methods.
459 * Stack.cs: Fixed possible integer overflow in CopyTo methods.
461 2004-03-13 Martin Baulig <martin@ximian.com>
463 * Stack.cs, Queue.cs, List.cs: Implement the non-generic interfaces.
465 2004-03-11 Martin Baulig <martin@ximian.com>
469 2004-03-11 Martin Baulig <martin@ximian.com>
471 * Stack.cs, Queue.cs: Just use `Node' for the nested class, not
472 `Node<T>' (which would create another type parameter `T'
473 overriding `T' from the outer class).
475 2004-02-23 Martin Baulig <martin@ximian.com>
477 * Stack.cs, Queue.cs: New files. Hmm, looks like I forgot to add
478 them to CVS; they're already on my hard disk since December or so.
480 2003-12-08 Martin Baulig <martin@ximian.com>
482 * *.cs: require GENERICS.
484 2003-11-08 Ben Maurer <bmaurer@users.sourceforge.net>
486 * *.cs: require NET_2_0 and GENERICS
488 2003-11-07 Ben Maurer <bmaurer@users.sourceforge.net>
490 * IComparable.cs, IComparer.cs, IDictionary.cs, IKeyComparer.cs, KeyValuePair.cs
493 2003-11-06 Martin Baulig <martin@ximian.com>
495 * ICollection.cs, IList.cs, IEnumerator.cs, IEnumerable.cs:
496 Started to implement the System.Collections.Generic classes.