I like the new "Split "if (a && b)" intention so much I'd like it to go one step further :

 
Sometimes, for code clarity in long if/else if sequence, I repeat unnecessary condition part (ex : ! zipChangeDetected below)
 
 
Example :
 
        if ( noErrorDetected  && zipChangeDetected ){
            method1 () ;
        }
        else if ( noErrorDetected  && ! zipChangeDetected){
            method2 () ;
        }
        else if ....
 
 
 
The split intention will build the following code :
 
        if ( noErrorDetected  ){
            if ( zipChangeDetected ){
                 method1 () ;
            }
        }
        else if ( noErrorDetected  && ! zipChangeDetected){
            method2 () ;
        }
        else if ....
 
 
 
While what I want is
 
        if ( noErrorDetected   ){
            if ( zipChangeDetected ){
                 method1 () ;
            }
            else {
                 method2 () ;
            }
        }
        else if ....
 
 
Alain Ravet

Reply via email to