httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: svn commit: r1187992 - /httpd/httpd/trunk/modules/filters/mod_filter.c
Date Mon, 24 Oct 2011 11:26:48 GMT
On Monday 24 October 2011, Roy T. Fielding wrote:
> Wouldn't this be faster as
> 
>         else if (r->content_type) {
> +           /* Handle 'content-type;charset=...' correctly */
> +           size_t len = strcspn(r->content_type, "; \t");
>             const char **type = provider->types;
>             AP_DEBUG_ASSERT(type != NULL);
>             while (*type) {
> +                if ((strncmp(*type, r->content_type, len) == 0) &&
> +                    (*type[len] == '\0')) {
>                     match = 1;
>                     break;
>                 }
>                 type++;
>             }
> 
> or am I just trying to outwit the compiler?

Fixed. Thanks.

Mime
View raw message