From 95329e10bee61848428c12e971fb9749a1285b55 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sat, 15 Sep 2012 12:49:15 +0300 Subject: [PATCH] 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... --- rpmio/rpmstrpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c index 799136b01..bdec16bce 100644 --- a/rpmio/rpmstrpool.c +++ b/rpmio/rpmstrpool.c @@ -82,7 +82,7 @@ void rpmstrPoolUnfreeze(rpmstrPool pool) { if (pool) { if (pool->hash == NULL) { - int sizehint = (pool->offs_size / 2) - 1; + int sizehint = pool->offs_size * 2; if (sizehint < STRHASH_INITSIZE) sizehint = STRHASH_INITSIZE; pool->hash = strHashCreate(sizehint, rstrhash, strcmp, NULL, NULL);