Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jbevain@gmail.com>2008-05-09 00:02:29 +0400
committerJb Evain <jbevain@gmail.com>2008-05-09 00:02:29 +0400
commit6ea580d53fa71a0358caa97bb430044b24c06cde (patch)
tree2fbef65f46d5cd5d89d22087ad5848713c87869f /mcs/class/System.Core/System.Linq/Enumerable.cs
parent7b4f6d8c736134ee1866aafffa85edf4bc2f4ae0 (diff)
refactoring
svn path=/trunk/mcs/; revision=102828
Diffstat (limited to 'mcs/class/System.Core/System.Linq/Enumerable.cs')
-rw-r--r--mcs/class/System.Core/System.Linq/Enumerable.cs13
1 files changed, 3 insertions, 10 deletions
diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs
index 6cfa2659868..ed54ec8c3c4 100644
--- a/mcs/class/System.Core/System.Linq/Enumerable.cs
+++ b/mcs/class/System.Core/System.Linq/Enumerable.cs
@@ -1687,10 +1687,10 @@ namespace System.Linq
Check.Source (source);
IList<TSource> list = source as IList<TSource>;
- if (list != null)
- return CreateReverseIterator (list);
+ if (list == null)
+ list = new List<TSource> (source);
- return CreateReverseIterator (source);
+ return CreateReverseIterator (list);
}
static IEnumerable<TSource> CreateReverseIterator<TSource> (IList<TSource> source)
@@ -1699,13 +1699,6 @@ namespace System.Linq
yield return source [i - 1];
}
- static IEnumerable<TSource> CreateReverseIterator<TSource> (IEnumerable<TSource> source)
- {
- var list = new List<TSource> (source);
- list.Reverse ();
- return list;
- }
-
#endregion
#region Select