0 Replies Last post: Feb 4, 2010 3:31 PM by Alexander Reifinger  
Guest
Currently Being Moderated

Feb 4, 2010 3:31 PM

Ignore not working

Hi again,

 

one more thing I noticed for some time now...

 

I have a list of commands like this:

 

if(cond1) return true;

if(cond2) return true;

if(cond3) return true;

if(cond4) return true;

return false;

 

with comments in between. I know this could be converted to:

 

return cond1 || cond2 || ...;

 

But because of the comments I would like to keep things as they are.

 

R# now tries to convert it to:

if(cond1) return true;

if(cond2) return true;

if(cond3) return true;

return cond4;

 

I don't want it to do this in this special case, so I used the disable

comment:

 

// ReSharper disable ConvertIfStatementToReturnStatement

if(cond4) {

   // ReSharper restore ConvertIfStatementToReturnStatement

   return true;

}

return false;

 

R# ignores this, though, and still wants to convert the if statement.

The comments where generated by R#, so either R# creates false comments

or it does not understand its own comments

 

Anyone who could comment on this?

 

Thanks,

Alexander

 

More Like This

  • Retrieving data ...