changeset 3643:762712d69672

break cycle early
author Igor Sysoev <igor@sysoev.ru>
date Thu, 24 Jun 2010 13:16:19 +0000
parents ac33852faaac
children 5d3282cfc43c
files src/http/modules/ngx_http_geo_module.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
         }
     }