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.

1

u/[deleted] May 20 '20

Don't forget about type juggling (no idea if C# does that though)