Commit Graph
20 Commits
Author SHA1 Message Date
Marek Safar ceb62fdbe8 Fix typo 2014-02-13 22:13:30 +01:00
Marek Safar 8d40cb5b9c [system] Fix valid sorted set operations which could cause underlying tree modification 2014-02-13 19:59:56 +01:00
Rodrigo Kumpera 1b92a4148c Since MOBILE implies NET_4_* now, take this into account and simplify our ifdefs. 2013-02-11 18:42:18 -05:00
Rolf Bjarne Kvinge 17f7c3dbb7 Include System.Collections.Generics.SortedSet in the mobile profile. Fixes #3827. 2012-03-13 12:37:59 +01:00
Marek Safar 482e63b5bd Few corcompare fixes 2011-09-05 19:02:32 +01:00
Jb Evain 6635351ed8 remove unused using
svn path=/trunk/mcs/; revision=155514
2010-04-15 16:12:45 +00:00
Raja R Harinath 195fec2107 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
2010-04-09 06:41:10 +00:00
Raja R Harinath c940e13b2b SortedSet: Enable set comparision operations on views, and improve performance
* 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
2010-04-07 16:31:25 +00:00
Jb Evain e67d275665 2010-04-06 Jb Evain <[email protected]>
* SortedSet.cs: implement Count for SortedSubSet.


svn path=/trunk/mcs/; revision=154840
2010-04-06 12:39:06 +00:00
Raja R Harinath 4478f7eb04 SortedSet: Complete implementation of more methods
* SortedSet.cs (IsProperSubsetOf, IsSubsetOf): Implement using ...
(is_subset_of): ... new helper.
(IsProperSupersetOf, IsSupersetOf): Implement using ...
(is_superset_of): ... new helper.
(covers, nodups, overlaps): New helpers.
(SetEquals): Implement.
(Overlaps): Implement using overlaps().
(SymmetricExceptWith): Use nodups() helper.

svn path=/trunk/mcs/; revision=154788
2010-04-05 09:59:41 +00:00
Raja R Harinath 40979641a2 SortedSet: implement IntersectWith, UnionWith, ExceptWith and SymmetricExceptWith
* System.Collections.Generic/SortedSet.cs (CheckArgumentNotNull): New helper.
(IntersectWith, UnionWith): Implement.
(ExceptWith, SymmetricExceptWith): Likewise.
(SortedSubSet.IntersectWith): Implement override.
* Test/System.Collections.Generic/SortedSetTest.cs: Add tests for IntersectWith,
UnionWith, ExceptWith and SymmetricExceptWith.

svn path=/trunk/mcs/; revision=154769
2010-04-04 18:22:37 +00:00
Jb Evain 66763c7baf 2010-04-02 Jb Evain <[email protected]>
* SortedSet.cs: implement Mix and Max for subsets.


svn path=/trunk/mcs/; revision=154725
2010-04-02 15:11:48 +00:00
Jb Evain 71b91562e5 2010-04-02 Jb Evain <[email protected]>
* SortedSet.cs: implement GetViewBetween.


svn path=/trunk/mcs/; revision=154722
2010-04-02 14:56:06 +00:00
Jb Evain 4b34728de0 refactoring
svn path=/trunk/mcs/; revision=154720
2010-04-02 13:42:38 +00:00
Jb Evain d71e62b2f8 2010-04-02 Jb Evain <[email protected]>
* SortedSet.cs: optimize Reverse. Add a virtual TryAdd and TryRemove
	to override in sub trees.


svn path=/trunk/mcs/; revision=154717
2010-04-02 13:36:23 +00:00
Jb Evain e1936f0a89 2010-04-02 Jb Evain <[email protected]>
* SortedSet.cs: implement Min and Max.


svn path=/trunk/mcs/; revision=154714
2010-04-02 12:28:09 +00:00
Jb Evain a902350772 2010-04-02 Jb Evain <[email protected]>
* SortedSet.cs: implement RemoveWhere.


svn path=/trunk/mcs/; revision=154709
2010-04-02 12:05:04 +00:00
Jb Evain 454311541b 2010-04-02 Jb Evain <[email protected]>
* SortedSet.cs: implement Reverse.


svn path=/trunk/mcs/; revision=154705
2010-04-02 10:53:41 +00:00
Jb Evain f9b47e69c8 2010-04-01 Jb Evain <[email protected]>
* SortedSet.cs: fix API.


svn path=/trunk/mcs/; revision=154654
2010-04-01 17:28:00 +00:00
Jb Evain ba41623fa7 2010-04-01 Jb Evain <[email protected]>
* SortedSet.cs: add new SortedSet type in .net 4.0


svn path=/trunk/mcs/; revision=154652
2010-04-01 17:05:57 +00:00