You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2005/10/12 15:06:01 UTC
svn commit: r314881 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Author: jim
Date: Wed Oct 12 06:05:59 2005
New Revision: 314881
URL: http://svn.apache.org/viewcvs?rev=314881&view=rev
Log:
Performance Tune: Do the cheap and fast length check before
we bother doing a char-by-char comparison.
Modified:
httpd/httpd/trunk/modules/proxy/proxy_util.c
Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=314881&r1=314880&r2=314881&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Wed Oct 12 06:05:59 2005
@@ -1231,9 +1231,9 @@
* 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;
}