Commit Graph
117 Commits
Author SHA1 Message Date
Marek Safar f1790decb8 [linq] Use hashtable lookup instead of linear scan for groupby keys. Fixes #18673 2014-04-30 11:55:17 +02:00
Blewzman 3eae2c2407 Support IReadOnlyList in System.Linq.Enumerable.ElementAt and ElementAtOrDefault - with additional unit tests. 2013-12-05 19:35:35 +01:00
Marek Safar 521a61ae5d [linq] Enumerable.Join and GroupJoin needs to ignore null keys. Fixes #16530 2013-12-02 19:03:37 +01:00
Marek Safar f0af91e211 Apply 9dc360146f to all where methods 2013-03-25 14:16:35 +01:00
Marek Safar 9dc360146f Add optimized where iterator for arrays 2013-03-24 15:03:22 +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
Rodrigo Kumpera 486ee8d8f4 Kill the MOONLIGHT define in System.Core. 2013-02-11 13:01:10 -05:00
bprzygoda 6d26bd6838 Wrapped IEnumerable extensions InvalidOperationException throws into factory methods.
Fixed incorrect messages for Average methods.
2012-11-13 09:49:17 +01:00
bprzygoda eb2232d372 Looked through all InvalidOperationException thrown by IEnumerable Linq extension methods, and added messages according to ms implementation.
In case of methods with predicate/selector, message is: 'Sequence contains no matching elements', wheras ms implementation just yields 'Sequence contains no elements, because it just calls predicateless/selectorless methods after filtering out the collection.
2012-11-13 07:12:02 +01:00
Andres G. Aragoneses caf7a8b2c0 [Linq] Return a clearer exception message for Enumerable<T>.First()'s IOE
This method was using the empty constructor (no message) of
InvalidOperationException if no element matched the predicate.
This meant that the message bubbled up would be a bit confusing:
"Operation is not valid due to the current state of the object".

This commit makes Mono match MS.NET by throwing "Sequence contains
no matching element"
2012-11-12 18:34:44 +00:00
Rodrigo Kumpera a219404ffc Use Function<T>:Identity instead of an inline lambda. Fixes 3627. 2012-11-07 13:38:55 -05:00
Rodrigo Kumpera 4fd392a280 Add workaround to make LINQ 4 Objects order by work under full-aot. 2012-11-07 13:38:44 -05:00
Sebastien Pouliot 63af5d90f1 Avoid multiple potential full-AOT failures with LINQ Enumerable. Fix bug #3285 2012-11-07 13:38:33 -05:00
Sebastien Pouliot 87f45773c0 Avoid using PredicateOf<T>.Always since it does not work with full-aot. Fix bug #682757... 2012-11-07 13:38:15 -05:00
Marek Safar 0bed23d764 Optimize Enumerable::ToArray 2011-02-08 13:56:22 +00:00
Geoff Norton 16d4fd790b Further .NET 4.0 ification of the mobile profile 2011-01-25 20:10:54 -05:00
Jb Evain cb3f41ca57 [linq] Fix Reverse for IList implementors 2011-01-26 00:08:11 +01:00
Jb Evain bce7739486 [linq] Fix overflow check for Count 2011-01-25 23:47:58 +01:00
Jb Evain f224ec361f [linq] fix Range extreme boundaries 2011-01-25 23:45:44 +01:00
Marek Safar bd05c6c836 Some .net 4.0 api compatibility fixes 2010-12-15 11:12:07 +00:00
Jb Evain d591966d45 [Fix] Enumerable.Except: return a duplicate free set. Fix bug #611821. 2010-08-19 12:37:24 +02:00
Jb Evain 7765cb325a 2010-07-14 Jb Evain <[email protected]>
* Enumerable.cs (Union): fix HashSet.Contains call.

svn path=/trunk/mcs/; revision=160337
2010-07-14 08:16:50 +00:00
Jb Evain 73c7b851cf 2010-07-13 Jb Evain <[email protected]>
* Enumerable.cs (Except): fix HashSet.Contains call.
	Fixes #621911.


svn path=/trunk/mcs/; revision=160298
2010-07-13 14:35:56 +00:00
Rolf Bjarne Kvinge 754903d2cf In class/System.Core:
2010-06-18  Rolf Bjarne Kvinge  <[email protected]>

	* System.Core/Dummy.cs:
	* moonlight_raw_System.Core.dll.sources: Add an internal dummy class to create
	the System.Core namespace.

	* Makefile:
	* moonlight_raw_System.Core.dll.sources: Include the dlr in Moonlight.

In class/System.Core/System.Linq:
2010-06-18  Rolf Bjarne Kvinge  <[email protected]>

	* EnumerableQuery.cs:
	* EnumerableQuery_T.cs:
	* EnumerableExecutor.cs:
	* EnumerableExecutor_T.cs: Include in Moonlight.

	* Enumerable.cs: Moonlight too needs Zip.

In class/System.Core/System.Runtime.CompilerServices:
2010-06-18  Rolf Bjarne Kvinge  <[email protected]>

	* ExecutionScope.cs: This class exists in Moonlight, but isn't supported.

	* StrongBox_T.cs:
	* DynamicAttribute.cs: Include in Moonlight.

svn path=/trunk/mcs/; revision=159111
2010-06-17 23:46:55 +00:00
Jb Evain deb0e467e0 2010-05-25 Jb Evain <[email protected]>
* Enumerable.cs: make Reverse lazier. Based on a patch by
	Matthew Flaschen <[email protected]>. Fixes #608195.


svn path=/trunk/mcs/; revision=157831
2010-05-25 08:56:12 +00:00
Jb Evain 3a9cf4b4cd 2010-05-19 Jb Evain <[email protected]>
* Enumerable.cs: fix GroupBy to deal with a null key for the last
	group entry. Also fix GroupBy to properly throw ArgumentNullException.


svn path=/trunk/mcs/; revision=157558
2010-05-19 14:41:12 +00:00
Miguel de Icaza 071f495d6a 2010-04-12 Miguel de Icaza <[email protected]>
* Enumerable.cs: Jumbo patch that inlines code, mainly for the AOT
	scenario where we our compiler cant infer the extra layer of
	indirection of a lambda function.

	But additionally, since we lack support for our JIT to inline
	intermediate delegate calls, it should save memory and run
	faster. 

svn path=/trunk/mcs/; revision=155280
2010-04-13 02:49:19 +00:00
Marek Safar 923e44a3cf 2010-02-23 Marek Safar <[email protected]>
* Enumerable.cs: Implement Zip.


svn path=/trunk/mcs/; revision=152260
2010-02-23 10:43:41 +00:00
Marek Safar 72cf126570 Better exception message.
svn path=/trunk/mcs/; revision=150391
2010-01-28 19:22:58 +00:00
Eric Maupin fe497ee144 * System.Linq/Lookup.cs: Support null keys
* System.Linq/Enumerable.cs: Support null keys

svn path=/trunk/mcs/; revision=146039
2009-11-12 13:56:46 +00:00
Marek Safar bf5999c08d Unused variable.
svn path=/trunk/mcs/; revision=143978
2009-10-12 19:12:58 +00:00
Marek Safar e7ff8ad2e7 2009-10-08 Marek Safar <[email protected]>
* Enumerable.cs (Empty): Optimized allocation.


svn path=/trunk/mcs/; revision=143778
2009-10-08 15:39:40 +00:00
Marek Safar ed47ca25ea 2009-08-07 Marek Safar <[email protected]>
* Enumerable.cs (Skip): Optimized and fixed int.MaxValue overflow.


svn path=/trunk/mcs/; revision=139558
2009-08-07 10:44:50 +00:00
Jb Evain 5877fe65ac 2009-05-18 Jb Evain <[email protected]>
* Enumerable.cs (Max, Min): fix generic versions.


svn path=/trunk/mcs/; revision=134333
2009-05-18 17:08:43 +00:00
Jb Evain db2a0eb2fb 2009-04-03 Jb Evain <[email protected]>
* Enumerable.cs (Cast): fix for when casted enumerator is already
	of the appropriate type.


svn path=/trunk/mcs/; revision=130961
2009-04-03 10:48:28 +00:00
Jb Evain cc2c56a916 2009-03-28 Jb Evain <[email protected]>
* Enumerable.cs: fix Intersect.


svn path=/trunk/mcs/; revision=130478
2009-03-28 21:55:24 +00:00
Marek Safar d93ce80221 2009-02-23 Marek Safar <[email protected]>
* Enumerable.cs (IterateNullable): Compare unwrapped values.


svn path=/trunk/mcs/; revision=127820
2009-02-23 22:34:17 +00:00
Jb Evain 5333294da5 2009-02-23 Jb Evain <[email protected]>
* Enumerable.cs (IterateNullable): fix initial value
	for nullables.


svn path=/trunk/mcs/; revision=127772
2009-02-23 18:12:55 +00:00
Jb Evain 99a81c984e 2009-01-22 Jb Evain <[email protected]>
* Enumerable.cs (Sum): check the sum operations for possible overfows.


svn path=/trunk/mcs/; revision=124216
2009-01-22 15:40:38 +00:00
Jb Evain 2c0250d4b4 reduce one level of indentation
svn path=/trunk/mcs/; revision=124213
2009-01-22 15:07:25 +00:00
Jb Evain a560d612bf 2009-01-22 Jb Evain <[email protected]>
* Enumerable.cs (SequenceEqual): make sure we dispose enumerators.


svn path=/trunk/mcs/; revision=124212
2009-01-22 15:05:35 +00:00
Jb Evain f470193a89 2009-01-22 Jb Evain <[email protected]>
* Enumerable.cs: optimize Last for lists.


svn path=/trunk/mcs/; revision=124210
2009-01-22 14:56:14 +00:00
Jb Evain 25950eda77 refactoring
svn path=/trunk/mcs/; revision=123508
2009-01-15 17:40:00 +00:00
Jb Evain 61d786b69a small refactoring
svn path=/trunk/mcs/; revision=123505
2009-01-15 17:34:05 +00:00
Jb Evain 0058cfe975 2008-11-20 Jb Evain <[email protected]>
* Enumerable.cs (Any): optimize if we're operating on an ICollection.


svn path=/trunk/mcs/; revision=119433
2008-11-20 12:57:59 +00:00
Sebastien Pouliot 6fb0b958fa 2008-09-28 Sebastien Pouliot <[email protected]>
* Enumerable.cs: Add missing cast Average on IEnumerable<long?> to
	ensure the result is not truncated.
	[Found using Gendarme's ReviewCastOnIntegerDivisionRule]


svn path=/trunk/mcs/; revision=114330
2008-09-28 14:55:32 +00:00
Jb Evain 935d94af6a 2008-09-11 Jb Evain <[email protected]>
* Enumerable.cs (Iterate*): use a bool empty instead of an int counter.
	Fixes #425344.


svn path=/trunk/mcs/; revision=112743
2008-09-11 07:20:08 +00:00
Marek Safar 13080c16fe Revert broken change
svn path=/trunk/mcs/; revision=110559
2008-08-15 10:01:39 +00:00
Marek Safar 0f31b0daf9 2007-08-14 Marek Safar <[email protected]>
* Enumerable.cs (Cast): Simplified.


svn path=/trunk/mcs/; revision=110526
2008-08-14 20:09:21 +00:00
Jb Evain 8d8a72bb90 fix #415644
svn path=/trunk/mcs/; revision=109948
2008-08-08 08:41:14 +00:00