Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkghash: Reduce the amount of memory allocated for the hash
Baptiste Daroussin committed 4 years ago
commit 91a326bdf0fb41a3e6a89faec31e9c76b8c3ad5e
parent ef8e715
1 file changed +1 -1
modified libpkg/pkghash.c
@@ -141,7 +141,7 @@ pkghash_expand(pkghash *table)
bool
pkghash_add(pkghash *table, const char *key, void *value, void (*free_func)(void *))
{
-
	if (table->count >= table->capacity / 2 && !pkghash_expand(table))
+
	if (table->count >= table->capacity -1 && !pkghash_expand(table))
		return (NULL);

	return (pkghash_set_entry(table->entries, table->capacity, key, value,