]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Performance Tune: Do the cheap and fast length check before
authorJim Jagielski <jim@apache.org>
Wed, 12 Oct 2005 13:05:59 +0000 (13:05 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 12 Oct 2005 13:05:59 +0000 (13:05 +0000)
we bother doing a char-by-char comparison.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@314881 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_util.c

index c5ee5776e67d9143702a8524d75c48199e6d675b..9470b59fdc85c70672c68f4eefb977843476293c 100644 (file)
@@ -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;
         }