Since the else if is following if (divisibleBy5), you don't really need to check !divisibleBy5 in it.
Edit: Also, since after making that change you'd then only be using divisibleBy5 once, you might as well just put the calculation directly into the if statement to free up that variable. But yours is really fine like it is for readability.
View all comments
Show parent comment
3
u/hbdgas Jan 16 '14 edited Jan 16 '14
Since the
else ifis followingif (divisibleBy5), you don't really need to check!divisibleBy5in it.Edit: Also, since after making that change you'd then only be using
divisibleBy5once, you might as well just put the calculation directly into theifstatement to free up that variable. But yours is really fine like it is for readability.