+void
+pool_resize_rels_hash(Pool *pool, int numnew)
+{
+ Hashval h, hh, hashmask;
+ Hashtable hashtbl;
+ int i;
+ Reldep *rd;
+
+ if (numnew <= 0)
+ return;
+ hashmask = mkmask(pool->nrels + numnew);
+ if (hashmask <= pool->relhashmask)
+ return; /* same as before */
+
+ /* realloc hash table */
+ pool->relhashmask = hashmask;
+ solv_free(pool->relhashtbl);
+ pool->relhashtbl = hashtbl = solv_calloc(hashmask + 1, sizeof(Id));
+
+ /* rehash all rels into new hashtable */
+ for (i = 1, rd = pool->rels + i; i < pool->nrels; i++, rd++)
+ {
+ h = relhash(rd->name, rd->evr, rd->flags) & hashmask;
+ hh = HASHCHAIN_START;
+ while (hashtbl[h])
+ h = HASHCHAIN_NEXT(h, hh, hashmask);
+ hashtbl[h] = i;
+ }
+}
+