diff options
-rw-r--r-- | pjlib/include/pj/hash.h | 2 | ||||
-rw-r--r-- | pjlib/src/pj/hash.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pjlib/include/pj/hash.h b/pjlib/include/pj/hash.h index 091c82b6..08056ca4 100644 --- a/pjlib/include/pj/hash.h +++ b/pjlib/include/pj/hash.h @@ -83,7 +83,7 @@ PJ_DECL(pj_uint32_t) pj_hash_calc_tolower(pj_uint32_t hval, * Create a hash table with the specified 'bucket' size. * * @param pool the pool from which the hash table will be allocated from. - * @param size the bucket size, which will be round-up to the nearest 2^n+1 + * @param size the bucket size, which will be round-up to the nearest 2^n-1 * * @return the hash table. */ diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index 5a03ecb8..a3daad3c 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -115,7 +115,7 @@ PJ_DEF(pj_hash_table_t*) pj_hash_create(pj_pool_t *pool, unsigned size) table_size = 8; do { table_size <<= 1; - } while (table_size <= size); + } while (table_size < size); table_size -= 1; h->rows = table_size; |