projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96ee0a8
)
[linq] Fix overflow check for Count
author
Jb Evain
<jbevain@gmail.com>
Tue, 25 Jan 2011 22:47:58 +0000
(23:47 +0100)
committer
Jb Evain
<jbevain@gmail.com>
Tue, 25 Jan 2011 22:47:58 +0000
(23:47 +0100)
mcs/class/System.Core/System.Linq/Enumerable.cs
patch
|
blob
|
history
diff --git
a/mcs/class/System.Core/System.Linq/Enumerable.cs
b/mcs/class/System.Core/System.Linq/Enumerable.cs
index 56d52d4f45391875d38289ed1c46b9af57243fd7..362099dc97d8fc0f28958370e4fcc87029ccabb0 100644
(file)
--- a/
mcs/class/System.Core/System.Linq/Enumerable.cs
+++ b/
mcs/class/System.Core/System.Linq/Enumerable.cs
@@
-637,7
+637,7
@@
namespace System.Linq
int counter = 0;
using (var enumerator = source.GetEnumerator ())
while (enumerator.MoveNext ())
- c
ounter++;
+ c
hecked { counter++; }
return counter;
}
@@
-649,7
+649,7
@@
namespace System.Linq
int counter = 0;
foreach (var element in source)
if (predicate (element))
- c
ounter++;
+ c
hecked { counter++; }
return counter;
}