Commit Graph
73 Commits
Author SHA1 Message Date
Marek Safar 482e63b5bd Few corcompare fixes 2011-09-05 19:02:32 +01:00
Alan McGovern 202db450f5 [LinkedList] Optimise Clear slightly. 2011-08-18 16:00:23 +01:00
Todd Foster e787a12ab2 Fix bug #311: On LinkedList.Clear, detach each node instead of dropping them en masse. 2011-08-17 11:30:53 -07:00
Lluis Sanchez e7ab7da200 Fix ICollection.CopyTo in the Stack class 2011-04-19 12:58:28 +02:00
Miguel de Icaza 48292550e8 More NET_2_0 define removal 2011-03-16 21:46:02 -04:00
Sebastien Pouliot 4eedff1487 Fix parameter name mismatches between Moonlight and Silverlight 2011-03-10 14:33:31 -05:00
Luke Halliwell c135c68bf6 Fix for bug 349053 - unable to serialize SortedDictionary 2011-01-03 21:43:27 -05:00
Marek Safar d84d7c7eb9 Remove no longer used BOOTSTRAP conditionals 2010-12-29 12:41:12 +00:00
Marek Safar 6fbaa0e59d Fixed warning
svn path=/trunk/mcs/; revision=156117
2010-04-26 17:17:50 +00: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
Raja R Harinath 5db7238202 * RBTree.cs (do_remove): Ensure the node returned is suitable for re-insertion.
svn path=/trunk/mcs/; revision=154762
2010-04-04 05:25:53 +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
Miguel de Icaza 5845129be7 2010-03-03 Miguel de Icaza <[email protected]>
* RBTree.cs: Make these serializable, should fix the serialization
	across appdomains of SortedDictionaries

svn path=/trunk/mcs/; revision=153922
2010-03-19 21:45:57 +00:00
Sebastien Pouliot dd1802b725 In System.Diagnostics:
2010-03-11  Sebastien Pouliot  <[email protected]>

	* Debug_2_1.cs: Change type to static to match SL4

In .:
2010-03-11  Sebastien Pouliot  <[email protected]>

	* net_2_1_raw_System.dll.sources: Add existing files that are 
	part of SL4

In System.Collections.Generic:
2010-03-11  Sebastien Pouliot  <[email protected]>

	* ISet.cs: Add NET_2_1 since this is part of SL4


svn path=/trunk/mcs/; revision=153477
2010-03-11 18:15:05 +00:00
Jb Evain 654b783fc0 2009-12-01 Jb Evain <[email protected]>
* Stack.cs (Enumerator.Dispose): tag the enumerator as finished
	upon Dispose.


svn path=/trunk/mcs/; revision=147248
2009-12-01 18:18:30 +00:00
Marek Safar e8bd31c03f 2009-11-26 Marek Safar <[email protected]>
* LinkedList.cs: Allocate less.


svn path=/trunk/mcs/; revision=146981
2009-11-26 13:01:23 +00:00
Jb Evain 2ece19dfb2 in System.Collections.Generic:
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
2009-11-25 17:30:16 +00:00
Jb Evain 108981cf3b in System.Collections.Generic:
2009-11-25  Jb Evain  <[email protected]>

	* Queue.cs (ICollection.CopyTo): fix typo, remove code duplication.

in Test/System.Collections.Generic:
2009-11-25  Jb Evain  <[email protected]>

	* QueueTest.cs: add tests for ICollection.CopyTo.

svn path=/trunk/mcs/; revision=146914
2009-11-25 15:43:49 +00:00
Marek Safar b248ca3947 Add to bootstrap
svn path=/trunk/mcs/; revision=146170
2009-11-13 18:42:35 +00:00
Miguel de Icaza d90afad63e 2009-11-02 Miguel de Icaza <[email protected]>
* Copy some collections from WindowsBase here for 4.0 support.

Add a handful of methods from 4.0 as well


svn path=/trunk/mcs/; revision=145180
2009-11-02 06:25:38 +00:00
Marek Safar 4420b773d7 2009-10-20 Marek Safar <[email protected]>
* SortedList.cs, LinkedList.cs, Queue.cs, Stack.cs,
	SortedDictionary.cs: Improve debugging experience.


svn path=/trunk/mcs/; revision=144438
2009-10-20 10:34:39 +00:00
Raja R Harinath 876b8f2fb6 Fix Enumerator.Current handling in SortedDictionary<,>
* System.Collections.Generic/RBTree.cs (NodeEnumerator.check_current):
 New helper.
(NodeEnumerator.Current): Don't check invariants.
* SortedDictionary.cs (Enumerator.Current): Likewise.
(ValueCollection.Enumerator.Current): Likewise.
(KeyCollection.Enumerator.Current): Likewise.

* Test/System.Collections.Generic/SortedDictionaryTest.cs
(Enumerator_Current, KeyEnumerator_Current, ValueEnumerator_Current): New tests.

svn path=/trunk/mcs/; revision=139115
2009-07-30 19:42:04 +00:00
Miguel de Icaza 1fc0a7899a 2009-07-22 Jb Evain <[email protected]>
* monotouch_System.dll.sources: bring Process in.

svn path=/trunk/mcs/; revision=138685
2009-07-26 16:05:47 +00:00
Gonzalo Paniagua Javier 05f367e52d 2009-07-14 Gonzalo Paniagua Javier <[email protected]>
* SortedList.cs: the IComparar.Compare arguments were reversed.
	Fixes bug #521750. Patch by Kevin Fitzgerald.


svn path=/trunk/mcs/; revision=137914
2009-07-15 01:02:35 +00:00
Andrés G. Aragoneses 1d1691647f 2009-05-10 Andy Hume <[email protected]>
* LinkedList.cs: Add null check. Fixes #481621.


svn path=/trunk/mcs/; revision=133864
2009-05-10 21:26:08 +00:00
Miguel de Icaza 0f4e81e0fd Contribution from Pia Eriksson <[email protected]> that fixes
the CopyTo method in various generic containers.

Also fixes #497720


svn path=/trunk/mcs/; revision=133700
2009-05-07 00:42:16 +00:00
Zoltan Varga bacf99dcd2 2009-03-11 Zoltan Varga <[email protected]>
* SortedList.cs: Add version checking to the Key/Value enumerators +
	implement support for Reset (). Fixes #483985.

svn path=/trunk/mcs/; revision=129076
2009-03-11 16:49:43 +00:00
Roei Erez 85523f250b Performance improvement for Stack, where it is popped until empty, and then pushed again.
svn path=/trunk/mcs/; revision=96531
2008-02-25 08:29:15 +00:00
Jb Evain 825886db36 2007-11-15 Jb Evain <[email protected]>
* LinkedList.cs: ifdef out manually the Serialization part of the
	LinkedList.Enumerator. As it is a struct, the field SerializationInfo
	have to be assigned in the default constructor, and the tuner cannot
	remove that. Fixes #341938 for real.

svn path=/trunk/mcs/; revision=89715
2007-11-15 22:10:14 +00:00
Jb Evain 7de8995e75 revert
svn path=/trunk/mcs/; revision=89714
2007-11-15 22:01:14 +00:00
Jb Evain 7a7a997f4b 2007-11-15 Jb Evain <[email protected]>
* LinkedList.cs: let's not have an access to the SerializationInfo
	field outside of serializations methods (We need a gendarme rule). Fixes #341938.


svn path=/trunk/mcs/; revision=89704
2007-11-15 20:36:46 +00:00
Raja R Harinath 9f6323ba73 * RBTree.cs (get_Item, do_remove): Remove redundant code.
svn path=/trunk/mcs/; revision=87165
2007-10-09 14:19:17 +00:00
Jb Evain fb7a99f5f1 in System.Collections.Generic:
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
2007-08-20 01:53:32 +00:00
Raja R Harinath 58dd5660cb Avoid unnecessary allocation on indexer access
* SortedDictionary.cs (NodeHelper): Rename from NodeComparer.
(NodeHelper.CreateNode): New.
(Item.set): Move responsibility of creating new nodes to RBTree.Intern.
* RBTree.cs (INodeHelper): Rename from INodeComparer.
(INodeHelper.CreateNode): New.
(Intern): Use it to create a new node if no node is passed in.

svn path=/trunk/mcs/; revision=76926
2007-05-08 12:59:50 +00:00
Igor Zelmanovich 082f8b2081 2007-05-08 Igor Zelmanovich <[email protected]>
* RBTree.cs: for TARGET_JVM used Thread Local Storage 
	istead Thread-Relative Static Fields 

	* TraceImpl.cs:
	* TraceListener.cs:
	for TARGET_JVM used Thread Local Storage istead 
	Thread-Relative Static Fields 


svn path=/trunk/mcs/; revision=76917
2007-05-08 11:18:26 +00:00
Raja R Harinath ceab758710 * RBTree.cs (Enumerator.Current): Remove nullref.
We need to have a generic IEnumerator test harness to catch these silly mistakes.

svn path=/trunk/mcs/; revision=76562
2007-05-02 11:19:37 +00:00
Raja R Harinath 2be5b62889 * SortedDictionary.cs (ICollection.Contains): Use EqualityComparer
for comparing the value field.

svn path=/trunk/mcs/; revision=76556
2007-05-02 09:26:21 +00:00