* System.Collections.Generic/SortedSet.cs (SortedSubSet.count): Remove.
(SortedSubSet..ctor): Move counting loop ...
(SortedSubSet.Count): ... here.
(SortedSubSet.TryAdd, SortedSubSet.TryRemove): Update to changes.
(SortedSubSet.GetMin, SortedSubSet.GetMax): Likewise. Use bounds
to determine if the view is empty, rather than the count.
* Test/System.Collections.Generic/SortedSetTest.cs (ViewCount):
Test that count reflects changes in underlying set.
svn path=/trunk/mcs/; revision=155125
* RBTree.cs (Bound): New. Returns the greatest lower bound and
least upper bound of the given key.
(GetSuffixEnumerator): New. Returns an enumerator that starts at
the given key.
(NodeEnumerator): Provide suffix enumerator functionality.
* SortedSet.cs (GetEnumerator): Delegate to ...
(TryGetEnumerator): ... this. New virtual function.
(Enumerator): Provide subset enumeration using RBTree's suffix enumerators.
(SortedSubSet.count): New.
(SortedSubSet.GetCount): Use it.
(SortedSubSet.TryAdd, SortedSubSet.TryRemove): Update count.
(SortedSubSet.GetMin, SortedSubSet.GetMax): Use RBTree.Bound().
(SortedSubSet.GetEnumerator): Remove.
(SortedSubSet.TryGetEnumerator): New. Use ranged enumerators.
* SortedSetTest.cs: Update to test more view functionality,
including set comparison operators.
svn path=/trunk/mcs/; revision=154974
2009-11-25 Jb Evain <[email protected]>
* Queue.cs (Enqueue): deal with the case where the tail
is off the array when deciding to enlarge the capacity.
in Test/System.Collections.Generic:
2009-11-25 Jb Evain <[email protected]>
* QueueTest.cs: add test for a specific combination of
calls that make the queue crash when enqueuing an item.
svn path=/trunk/mcs/; revision=146925
* LinkedListTest.cs: Added NotWorking test for #481621,
converted from example code by Andy Hume <[email protected]>.
svn path=/trunk/mcs/; revision=133858
2007-08-20 Jb Evain <[email protected]>
* SortedList.cs: don't crash in ListKeys and ListValues
when CopyTo targets an empty array, and that the
sorted list is empty. Fixes#82492.
in Tests/System.Collections.Generic:
2007-08-20 Jb Evain <[email protected]>
* SortedListTest.cs: Tests for #82492.
svn path=/trunk/mcs/; revision=84419
* System.dll.sources: Add RBTree.cs.
In System.Collections.Generic:
Make add and remove operations O(log n).
* SortedDictionary.cs: Rewrite to use the red-black tree
implementation from RBTree.cs.
* RBTree.cs: Some more refactoring. Rename Insert() to Intern(),
and modify semantics slightly. Replace Contains() with Lookup().
In Test/System.Collections.Generic:
* SortedDictionaryTest.cs (AddNullKeyNullable): Enable.
svn path=/trunk/mcs/; revision=76537
test for TrimExcess. Added tests for binary serialization.
* StackTest.cs: Removed usage of deprecated Assertion class. Added
test for TrimExcess. Added tests for binary serialization.
* Queue.cs: Fixed binary serialization, based on patch provided by
Lionel Cuir. Fixes TrimExcess to use SetCapacity, before it was not
updating _head which could lead to IndexOutOfRangeException.
* Stack.cs: Fixed binary serialization, based on patch provided by
Lionel Cuir. In Pop, clear entry from array to help GC.
svn path=/trunk/mcs/; revision=76069