summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-15 12:49:15 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-15 12:49:15 +0300
commit95329e10bee61848428c12e971fb9749a1285b55 (patch)
tree2199e4dacea81f5e9a80f5f120d79d718af53000 /rpmio
parent57f9d42a0eb380d93dfe8efeb52f366e754ad0c9 (diff)
downloadlibrpm-tizen-95329e10bee61848428c12e971fb9749a1285b55.tar.gz
librpm-tizen-95329e10bee61848428c12e971fb9749a1285b55.tar.bz2
librpm-tizen-95329e10bee61848428c12e971fb9749a1285b55.zip
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...
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmstrpool.c2
1 files changed, 1 insertions, 1 deletions
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);