# HG changeset patch # User Igor Sysoev # Date 1277385379 0 # Node ID 762712d6967269f634155f16245c713833d868cc # Parent ac33852faaac47db23a83d6a76629037dfcc9bc8 break cycle early diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c --- a/src/http/modules/ngx_http_geo_module.c +++ b/src/http/modules/ngx_http_geo_module.c @@ -166,10 +166,10 @@ ngx_http_geo_range_variable(ngx_http_req n = addr & 0xffff; for (i = 0; i < ctx->u.high->low[addr >> 16].n; i++) { - if (n >= (ngx_uint_t) range[i].start - && n <= (ngx_uint_t) range[i].end) + if (n >= (ngx_uint_t) range[i].start && n <= (ngx_uint_t) range[i].end) { *v = *range[i].value; + break; } }