Mercurial > hg > nginx
comparison src/core/ngx_hash.c @ 5636:54f847c88cf7
Core: fixed hash to actually try max_size.
Previously, maximum size of a hash table built was (max_size - 1).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 31 Mar 2014 21:40:35 +0400 |
parents | c348dea081fb |
children | 5e72578e6503 |
comparison
equal
deleted
inserted
replaced
5635:c348dea081fb | 5636:54f847c88cf7 |
---|---|
280 | 280 |
281 if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) { | 281 if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) { |
282 start = hinit->max_size - 1000; | 282 start = hinit->max_size - 1000; |
283 } | 283 } |
284 | 284 |
285 for (size = start; size < hinit->max_size; size++) { | 285 for (size = start; size <= hinit->max_size; size++) { |
286 | 286 |
287 ngx_memzero(test, size * sizeof(u_short)); | 287 ngx_memzero(test, size * sizeof(u_short)); |
288 | 288 |
289 for (n = 0; n < nelts; n++) { | 289 for (n = 0; n < nelts; n++) { |
290 if (names[n].key.data == NULL) { | 290 if (names[n].key.data == NULL) { |