httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: [PATCH] version 2.0 / mod_include.c
Date Sun, 22 Jul 2001 22:56:06 GMT
On Sunday 22 July 2001 13:46, G√ľnter Knauf wrote:
> Hi,
> here's a little cosmetic patch:
> with httpd-2.0 nonexistant SSI vars appear as '(none', the right bracket is
> missing.
>
> -                    tmp_buck = apr_bucket_immortal_create("(none)", sizeof("none"));
> +                    tmp_buck = apr_bucket_immortal_create("(none)", 6);
>
> as the string is hardcoded I've hardcoded the length too for speed.

I dislike hard-coding the length, because it makes it less obvious that we
are talking about the length of the string.  Since we are using sizeof, and especially
since we have hard-coded the string in the sizeof, any decent compiler will optimize
this to the hard-coded value anyway, so the performance benefit really shouldn't
exist.  I will fix the bug by just using sizeof("(none)") in the code and commit
today.  Also, C++ comments can really mess up some C compilers.  In the future, please
only use C style comments.  Great catch!

Ryan

_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------

Mime
View raw message