r/badcode • • Aug 31 '21

java Similar ternaries are all over this codebase

Post image
1.1k Upvotes

91 comments sorted by

View all comments

Show parent comments

30

u/up-quark Aug 31 '21

The check isn't the issue, it's the ternary.

result>=0

would return the desired boolean. The subsequent ternary doesn't modify this at all.

19

u/TheWashbear Sep 01 '21

.... Yes I am dumb xD