diff options
author | Jb Evain <jbevain@gmail.com> | 2009-04-03 14:48:28 +0400 |
---|---|---|
committer | Jb Evain <jbevain@gmail.com> | 2009-04-03 14:48:28 +0400 |
commit | db2a0eb2fbf73b6c77879e459565f61feecdbe9d (patch) | |
tree | 92a9e7787e2fb5442cfd5117fb8ef0f63d0763e7 /mcs/class/System.Core/System.Linq/Enumerable.cs | |
parent | 556928a589e2c24e2866de9c0a6861f2b487cf31 (diff) |
2009-04-03 Jb Evain <jbevain@novell.com>
* Enumerable.cs (Cast): fix for when casted enumerator is already
of the appropriate type.
svn path=/trunk/mcs/; revision=130961
Diffstat (limited to 'mcs/class/System.Core/System.Linq/Enumerable.cs')
-rw-r--r-- | mcs/class/System.Core/System.Linq/Enumerable.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index d2c98d0a195..0459dfc4d76 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -335,6 +335,10 @@ namespace System.Linq { Check.Source (source); + var actual = source as IEnumerable<TResult>; + if (actual != null) + return actual; + return CreateCastIterator<TResult> (source); } |