Remove redundant ternary expression

Replace it with casting to a boolean
Merge pull request #3174 from camspiers/patch-1

Remove redundant ternary expression