Browse Source

2007-11-22 Atsushi Enomoto <[email protected]>

	* Enumerable.cs : fixed Range(int,int) that iterated one less.
	  Thanks to http://d.hatena.ne.jp/NyaRuRu/ .


svn path=/trunk/mcs/; revision=90127
Atsushi Eno 18 years ago
parent
commit
63e87916ef

+ 5 - 0
mcs/class/System.Core/System.Linq/ChangeLog

@@ -1,3 +1,8 @@
+2007-11-22  Atsushi Enomoto  <[email protected]>
+
+	* Enumerable.cs : fixed Range(int,int) that iterated one less.
+	  Thanks to http://d.hatena.ne.jp/NyaRuRu/ .
+
 2007-11-13  Jb Evain  <[email protected]>
 
 	* Enumerable.cs: make the new unit tests pass.

+ 1 - 1
mcs/class/System.Core/System.Linq/Enumerable.cs

@@ -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;
 		}