Change if to ternary operator

Two expected scenarios

Return

if (something)
    return a;
else
    return b;

Becomes:

return something ? a : b;

If necessary, cast a to the expected value;

Attribution

if (something)
    v = a;
else
    v = b;

Becomes:

v = something ? a : b;