2007-11-22 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 22 Nov 2007 08:53:08 +0000 (08:53 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 22 Nov 2007 08:53:08 +0000 (08:53 -0000)
* Enumerable.cs : fixed Range(int,int) that iterated one less.
  Thanks to http://d.hatena.ne.jp/NyaRuRu/ .

svn path=/trunk/mcs/; revision=90127

mcs/class/System.Core/System.Linq/ChangeLog
mcs/class/System.Core/System.Linq/Enumerable.cs

index 6f9d53f3f2c625924c5c3fdf23edd185220fff30..f54d07f4c0d977eade804884dd9a445577814925 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-22  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * Enumerable.cs : fixed Range(int,int) that iterated one less.
+         Thanks to http://d.hatena.ne.jp/NyaRuRu/ .
+
 2007-11-13  Jb Evain  <jbevain@novell.com>
 
        * Enumerable.cs: make the new unit tests pass.
index a26bd8b904b8acb1bff4387bc51b0e66e7ffde48..f5990d5c12228661b632336a034673757290c08a 100644 (file)
@@ -1799,7 +1799,7 @@ namespace System.Linq
                        if (count < 0 || upto > int.MaxValue)
                                throw new ArgumentOutOfRangeException ();
 
-                       for (int i = start; i < upto; i++)
+                       for (int i = start; i <= upto; i++)
                                yield return i;
                }