Deduplicate expression with ternary if

Narrow the scope of the if/else expression to just the function, since everything else is the same.

Note that this program doesn't improve the password at all; a low-entropy password is still a low-entropy password, no matter what transformations are done to it. It's just a toy program, not a security device - at least, I hope it's treated as a toy :)
Merge pull request #2 from Rosuav/patch-1

Deduplicate expression with ternary if