diff options
author | Jim Jagielski <jim@apache.org> | 2005-10-12 13:05:59 +0000 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2005-10-12 13:05:59 +0000 |
commit | 388871d089d52c1d18b75212131e00d3aed0207a (patch) | |
tree | a6cbdacd4d696ec314b9c6fa06e3fa9f40448c61 /modules | |
parent | 3ed4f2af575f5273e955447547e2e5f2d9408439 (diff) | |
download | httpd-388871d089d52c1d18b75212131e00d3aed0207a.tar.gz |
Performance Tune: Do the cheap and fast length check before
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
Diffstat (limited to 'modules')
-rw-r--r-- | modules/proxy/proxy_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index c5ee5776e6..9470b59fdc 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; } |