Mercurial > hg > nginx
changeset 1012:11ffb8e4753f
stop rbtree search early if equal hash was found
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 11 Jan 2007 16:57:30 +0000 |
parents | 19118c44303f |
children | 7dd987e09701 |
files | src/http/modules/ngx_http_limit_zone_module.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_limit_zone_module.c Thu Jan 11 16:50:06 2007 +0000 +++ b/src/http/modules/ngx_http_limit_zone_module.c Thu Jan 11 16:57:30 2007 +0000 @@ -173,7 +173,9 @@ continue; } - if (hash == node->key ){ + /* hash == node->key */ + + do { lz = (ngx_http_limit_zone_node_t *) &node->color; if (len == (size_t) lz->len @@ -188,7 +190,12 @@ return NGX_HTTP_SERVICE_UNAVAILABLE; } - } + + node = node->right; + + } while (node != sentinel && hash == node->key); + + break; } n = offsetof(ngx_rbtree_node_t, color)