mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
stop rbtree search early if equal hash was found
This commit is contained in:
parent
ec582de2dd
commit
1279b049b4
@ -173,7 +173,9 @@ ngx_http_limit_zone_handler(ngx_http_request_t *r)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hash == node->key ){
|
/* hash == node->key */
|
||||||
|
|
||||||
|
do {
|
||||||
lz = (ngx_http_limit_zone_node_t *) &node->color;
|
lz = (ngx_http_limit_zone_node_t *) &node->color;
|
||||||
|
|
||||||
if (len == (size_t) lz->len
|
if (len == (size_t) lz->len
|
||||||
@ -188,7 +190,12 @@ ngx_http_limit_zone_handler(ngx_http_request_t *r)
|
|||||||
|
|
||||||
return NGX_HTTP_SERVICE_UNAVAILABLE;
|
return NGX_HTTP_SERVICE_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
node = node->right;
|
||||||
|
|
||||||
|
} while (node != sentinel && hash == node->key);
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = offsetof(ngx_rbtree_node_t, color)
|
n = offsetof(ngx_rbtree_node_t, color)
|
||||||
|
Loading…
Reference in New Issue
Block a user