From 54d080503f33feab5b5764a32e36d0c95b87df2a Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 12 Oct 2005 13:06:24 +0000 Subject: [PATCH] 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 --- modules/proxy/proxy_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.47.2