* lib/hash.c (hash_rehash): Recognize useless rehash attempts.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-06-18 Eric Blake <ebb9@byu.net>
+ hash: avoid no-op rehashing
+ * lib/hash.c (hash_rehash): Recognize useless rehash attempts.
+
hash: provide default callback functions
* lib/hash.c (raw_hasher, raw_comparator): New functions.
(hash_initialize): Use them as defaults.
table->comparator, table->data_freer);
if (new_table == NULL)
return false;
+ if (new_table->n_buckets == table->n_buckets)
+ return true;
/* Merely reuse the extra old space into the new table. */
#if USE_OBSTACK