Fix missing casts in Enumerable.Select assert (dotnet/corefx#37410) (dotnet/corefx...
authorTim <xuchonglei@126.com>
Fri, 17 May 2019 06:08:25 +0000 (14:08 +0800)
committerStephen Toub <stoub@microsoft.com>
Fri, 17 May 2019 06:08:25 +0000 (23:08 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/6f9570e012054bf407778c0b07632e7733ecbb13

src/libraries/System.Linq/src/System/Linq/Select.SpeedOpt.cs

index b226a75..b3d3b6f 100644 (file)
@@ -171,7 +171,7 @@ namespace System.Linq
             public SelectRangeIterator(int start, int end, Func<int, TResult> selector)
             {
                 Debug.Assert(start < end);
-                Debug.Assert((end - start) <= int.MaxValue);
+                Debug.Assert((uint)(end - start) <= (uint)int.MaxValue);
                 Debug.Assert(selector != null);
 
                 _start = start;