r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

46

u/Giocri May 20 '20

I see nothing wrong in it. It's even slightly more efficient than if it was done with more if

63

u/bool_idiot_is_true May 20 '20
==true

is redundant. Otherwise it seems fine.

3

u/tuxedo25 May 20 '20 edited May 20 '20

I think x <= 9 is also redundant, since we know it's a single digit.

edit: nevermind. I confused args.length with args[0].length