Reverse assignments

I have a developer that loves writing code ala:

if ( null == foo )

vs.

if ( foo == null )

Is there a way of creating a rule that will reverse this sort of thing?

1 comment

Hello Thomas
     You can find and replace such conditions using the following structural search pattern: null == $var$ where $var$ is and identifier (for more information on SSR please see http://www.jetbrains.com/resharper/webhelp/Navigation_and_Search__Structural_Search_and_Replace.html). Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0

Please sign in to leave a comment.