You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Int32 count = 0;
Parallel.ForEach( foos, (foo) =>
{
lock( _lock )
{
// do stuff
count++;
}
}
Int32 x = GetX();
if( 0 <= x && x < count ) {
// more stuff
}
I get this warning:
CodeContracts warning: The Boolean condition x < 0 always evaluates to a constant value. If it (or its negation) appear in the source code, you may have some dead code or a redundant check.
The expression 0 <= x && x < count has a purple squiggle underline.
If I change the Parallel.ForEach to a regular foreach then I don't get the warning.
I'm using Code Contracts 1.9.10714.2 in VS2015 Enterprise Update 3.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have code in a function which does this:
I get this warning:
The expression
0 <= x && x < count
has a purple squiggle underline.If I change the
Parallel.ForEach
to a regularforeach
then I don't get the warning.I'm using Code Contracts 1.9.10714.2 in VS2015 Enterprise Update 3.
The text was updated successfully, but these errors were encountered: