break cycle early
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index 40c11f2..8d96ff2 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -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;
         }
     }