From 70249b98575f3e04d5058f18682d5bd242cb6710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 16 Dec 2010 17:07:50 +0100 Subject: [PATCH] Rehash weak hash tables less frequently. * libguile/hashtab.c (weak_bucket_assoc): Call `scm_i_rehash' only when REMAINING is below `SCM_HASHTABLE_LOWER (table)'. --- libguile/hashtab.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libguile/hashtab.c b/libguile/hashtab.c index d5f39cbd8..b7cc72b72 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -222,7 +222,8 @@ weak_bucket_assoc (SCM table, SCM buckets, size_t bucket_index, remaining = SCM_HASHTABLE_N_ITEMS (table) - args.removed_items; SCM_SET_HASHTABLE_N_ITEMS (table, remaining); - scm_i_rehash (table, hash_fn, closure, "weak_bucket_assoc"); + if (remaining < SCM_HASHTABLE_LOWER (table)) + scm_i_rehash (table, hash_fn, closure, "weak_bucket_assoc"); } return result;