ed4ea7f1f4
* No change in logic !
Just exchanging the if and else code blocks and negating condition.
* remove unneeded else{} block
* Re-indented the code