Working on a project and the coder does this a lot in his checks. First, he checks if the nullable int has a value, and then he checks if it’s greater than 0. Why? Why make two checks if one check (if it is greater than 0) should be sufficient? Since nulls are not greater than 0, wouldn’t that be redundant?
Working on a project and the coder does this a lot in his checks.
Share
The code is probably redundant.
If i is
int?then:is equivalent to:
From MSDN: