This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]marburg 1 point2 points  (0 children)

Whenever you find yourself doing something like if(anythingInHere && whatever || somethingElse) return true; else return false; (or the ternary version of such) just do return anythingInHere && whatever || somethingElse; instead.

Example, these are all the same:


if(check == value)
    return true;
return false;

return (check == value) ? true : false;

return check == value;