Agreed.

I'd prefer to see

var retVal = E_FAIL;
var foo = f();
if (foo) {
   // do other stuff
   retVal = NOT_FAIL;
}
return retVal;

e.g. one return with tests for success rather than lots of returns on failure.
But maybe I just like braces...

A


On 15/03/06, Alex Vincent <[EMAIL PROTECTED]> wrote:
> I'd actually advise against any such shortcut, as they make the code
> less readable, and debugging thus becomes harder.  For this kind of
> optimization, I don't see that it's worth it.
>
> --
> "The first step in confirming there is a bug in someone else's work is
> confirming there are no bugs in your own."
> -- Alexander J. Vincent, June 30, 2001
> _______________________________________________
> Project_owners mailing list
> [email protected]
> http://mozdev.org/mailman/listinfo/project_owners
>
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to