Less complex code.

When if is for the full function body it is better to check the opposite
condition and to use return.