ecj2 / momo

[NOT MAINTAINED / ABANDONED] A simple 2D game-making library written in JavaScript.
MIT License
1 stars 0 forks source link

Needless Ternary Operator #23

Closed bambams closed 6 years ago

bambams commented 6 years ago

https://github.com/ecj2/momo/blob/b74929b0ba6c208fbc587eb6edd44dcbe3b9bec2/momo.js#L283

Case of a useless ternary operator. Any time you have boolean_expr() ? true : false or boolean_expr() ? false : true you are being redundant. The boolean_expr() is already your result (or the inverse of it is).

ecj2 commented 6 years ago

You're absolutely right. Thanks for pointing this out!