SortedSet: Don't maintain state in the view
authorRaja R Harinath <harinath@hurrynot.org>
Fri, 9 Apr 2010 06:41:10 +0000 (06:41 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Fri, 9 Apr 2010 06:41:10 +0000 (06:41 -0000)
commit195fec21076da134da39c24a5cc4634f0f8221d3
tree04a07a5877e59eab6ecb3b91bc63bc543e7f4ce4
parent6ab67da5b9e579f256699e081deab7b68dca8725
SortedSet: Don't maintain state in the view

* 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
mcs/class/System/System.Collections.Generic/ChangeLog
mcs/class/System/System.Collections.Generic/SortedSet.cs
mcs/class/System/Test/System.Collections.Generic/ChangeLog
mcs/class/System/Test/System.Collections.Generic/SortedSetTest.cs