httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Ames <>
Subject Re: cvs commit: httpd-2.0/server core.c
Date Tue, 30 Apr 2002 21:09:22 GMT
"Roy T. Fielding" wrote:
> I don't understand why you didn't simply reverse the test and
> enclose the frequent case inside the if {} block.  

D'oh!  of course!  commit coming shortly.

>               I assume it
> was just to avoid indenting a large block of code, which is not
> sufficient justification for a goto.

No, it just didn't occur to me at the time.  I wouldn't want to use that
technique for all of the error cases though.  Then the indentation would get out
of hand.

I've seen kernel level code that used a pattern like:

if (funky_error1) then {
    goto exit_with_error1;
do important stuff;
if (funky_error2) then {
    goto exit_with_error2;
do more stuff;
etc etc;

...which resulted in cache friendly code that this goto agnostic didn't have any
trouble reading.  I guess that pattern imprinted itself on my brain.


View raw message