From 8d8a72bb90140ab403a0e9e134ae95d2c87cc6bc Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Fri, 8 Aug 2008 08:41:14 +0000 Subject: fix #415644 svn path=/trunk/mcs/; revision=109948 --- mcs/class/System.Core/System.Linq/Enumerable.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mcs/class/System.Core/System.Linq/Enumerable.cs') diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index b7829d77a73..d8de3a8c66c 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -2029,10 +2029,10 @@ namespace System.Linq int counter = 0; foreach (TSource element in source) { - if (counter++ == count) - yield break; - yield return element; + + if (++counter == count) + yield break; } } -- cgit v1.2.3