My favorites | Sign in
Project Logo
                
Search
for
Updated Jul 18, 2008 by jakob.sitecore
InvertReturnValue  

Inverts the return value of a boolean method.

This is useful when renaming a method to a name that changes the semantics of the return value, e.g. from "IsNull" to "IsNotNull".

Example:

bool Foo(int x, int y) {
  if (x > 100) {
    return true;
  }

  return x < y;
}

to

bool Foo(int x, int y) {
  if (x > 100) {
    return false;
  }

  return !(x < y);
}

Comment by ilya.ryzhenkov, Oct 08, 2008

Does it update usages?


Sign in to add a comment
Hosted by Google Code