djabberd / DJabberd

The main DJabberd source
89 stars 35 forks source link

Don't leave eval via next #17

Closed dominikschulz closed 12 years ago

dominikschulz commented 12 years ago

Eval is not a loop and as such should not be left using loop control statements.

This commit replaces those next statements with return statements. The control flow should be exactly the same since the enclosing loop will move on to the next iteration after a successfull return from the eval.

dominikschulz commented 12 years ago

Actually the build didn't fail ... travis failed.

abh commented 12 years ago

Why return 1 instead of just return?

dominikschulz commented 12 years ago

Usually "return 1" is used to indicate that something was successful. In this case it is used to indicate that the option was successfully processed. We could use a bare "return" instead, but that could possible lead to confusion in the future.

I've seen plenty of examples where a little more verbosity would have prevented serious bugs, but I'd be fine with a bare return, too.

Please advise.

dominikschulz commented 12 years ago

Ok, so bare return it is. I'll update the PR ASAP.

dominikschulz commented 12 years ago

Using bare returns as per request and rebased to latest HEAD.

yannk commented 12 years ago

done