Better to use ternary (?:) operator for such cases.