summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/pkghash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c
index 0324465f..8f7168d2 100644
--- a/lib/libalpm/pkghash.c
+++ b/lib/libalpm/pkghash.c
@@ -98,10 +98,12 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash)
* require a table size increase that large. */
if(oldhash->buckets < 500) {
newsize = oldhash->buckets * 2;
- } else if(oldhash->buckets < 3500) {
+ } else if(oldhash->buckets < 2000) {
newsize = oldhash->buckets * 3 / 2;
- } else {
+ } else if(oldhash->buckets < 5000) {
newsize = oldhash->buckets * 4 / 3;
+ } else {
+ newsize = oldhash->buckets + 1;
}
newhash = _alpm_pkghash_create(newsize);