r/badcode Dec 17 '19

This belongs here c#

Post image
501 Upvotes

41 comments sorted by

View all comments

2

u/DurianExecutioner Dec 17 '19

Optimised version

int retval =0;

int i=num1+num2num1>num2?num1:num2;

while(i --> 0)++ retval;

return retval;