From: Jim Jagielski Date: Wed, 12 Oct 2005 13:06:24 +0000 (+0000) Subject: Merge r314881 from trunk: X-Git-Tag: 2.1.9~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54d080503f33feab5b5764a32e36d0c95b87df2a;p=thirdparty%2Fapache%2Fhttpd.git Merge r314881 from trunk: Performance Tune: Do the cheap and fast length check before we bother doing a char-by-char comparison. Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@314883 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index c5ee5776e67..9470b59fdc8 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1231,9 +1231,9 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p, * fits best to the URL. */ for (i = 0; i < conf->workers->nelts; i++) { - if (((worker_name_length = strlen(worker->name)) <= url_length) - && (strncasecmp(url, worker->name, worker_name_length) == 0) - && (worker_name_length > max_match)) { + if ( ((worker_name_length = strlen(worker->name)) <= url_length) + && (worker_name_length > max_match) + && (strncasecmp(url, worker->name, worker_name_length) == 0) ) { max_worker = worker; max_match = worker_name_length; }