If you really want to get anal:

  if ((*tag == 'v' && strcmp(tag, "virtual") == 0)
      || ...

You can avoid a whole strcmp.

woo! (not)

Then again, you'd just be obfuscating the damned code for little overall
gain.

Cheers,
-g

On Fri, Dec 07, 2001 at 03:09:54AM -0000, [EMAIL PROTECTED] wrote:
> brianp      01/12/06 19:09:54
> 
>   Modified:    modules/filters mod_include.c
>   Log:
>   When checking for "file" or "virtual" as an argument to
>   "<!--#", check for "virtual" first.  That's the more likely
>   case (assuming that people follow the recommendation in
>   the mod_include documentation that "virtual" be used in
>   preference to "file"), so by checking for "virtual" first
>   we can short-circuit out of the conditional after one
>   strcmp instead of two.
>   
>   Revision  Changes    Path
>   1.164     +1 -1      httpd-2.0/modules/filters/mod_include.c
>   
>   Index: mod_include.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
>   retrieving revision 1.163
>   retrieving revision 1.164
>   diff -u -r1.163 -r1.164
>   --- mod_include.c   2001/12/02 19:16:01     1.163
>   +++ mod_include.c   2001/12/07 03:09:54     1.164
>   @@ -1034,7 +1034,7 @@
>                        return (1);
>                    }
>                }
>   -            if (!strcmp(tag, "file") || !strcmp(tag, "virtual")) {
>   +            if (!strcmp(tag, "virtual") || !strcmp(tag, "file")) {
>                    request_rec *rr = NULL;
>                    char *error_fmt = NULL;
>    
>   
>   
>   

-- 
Greg Stein, http://www.lyra.org/

Reply via email to