Use a saner pool hash resize hint

- The previous size hint would actually cause us to shrink the hash
  bucket allocation, requiring the hash to resize itself immediately
  afterwards. As if the rehashes weren't expensive enough already...
This commit is contained in:
Panu Matilainen 2012-09-15 12:49:15 +03:00
parent 57f9d42a0e
commit 95329e10be
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ void rpmstrPoolUnfreeze(rpmstrPool pool)
{ {
if (pool) { if (pool) {
if (pool->hash == NULL) { if (pool->hash == NULL) {
int sizehint = (pool->offs_size / 2) - 1; int sizehint = pool->offs_size * 2;
if (sizehint < STRHASH_INITSIZE) if (sizehint < STRHASH_INITSIZE)
sizehint = STRHASH_INITSIZE; sizehint = STRHASH_INITSIZE;
pool->hash = strHashCreate(sizehint, rstrhash, strcmp, NULL, NULL); pool->hash = strHashCreate(sizehint, rstrhash, strcmp, NULL, NULL);