]> git.kaiwu.me - nginx.git/commitdiff
Core: fixed hash to actually try max_size.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 31 Mar 2014 17:40:35 +0000 (21:40 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 31 Mar 2014 17:40:35 +0000 (21:40 +0400)
Previously, maximum size of a hash table built was (max_size - 1).

src/core/ngx_hash.c

index fe95693ab1b3d39e36ce32dfd4df6ebc642916f0..c7bfed709798fe51adf4aa390adbfbc2520d4229 100644 (file)
@@ -282,7 +282,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
         start = hinit->max_size - 1000;
     }
 
-    for (size = start; size < hinit->max_size; size++) {
+    for (size = start; size <= hinit->max_size; size++) {
 
         ngx_memzero(test, size * sizeof(u_short));