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	Wed Jun 23 16:34:54 2010 +0000
+++ b/src/http/modules/ngx_http_geo_module.c	Thu Jun 24 13:16:19 2010 +0000
@@ -166,10 +166,10 @@
     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;
         }
     }