From 8be1058a8b00d1ada767e646be43329d2801a2e0 Mon Sep 17 00:00:00 2001 From: luben Date: Sun, 15 Aug 2010 03:51:29 +0300 Subject: [PATCH 6/7] another manual iteration over hashes replaced with macro --- src/hash.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/hash.c b/src/hash.c index 8f5bcf2..74ee64e 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1115,17 +1115,9 @@ void parrot_chash_destroy_values(PARROT_INTERP, ARGMOD(Hash *hash), NOTNULL(value_free func)) { ASSERT_ARGS(parrot_chash_destroy_values) - UINTVAL i; - - for (i = 0; i <= hash->mask; ++i) { - HashBucket *bucket = hash->index[i]; - while (bucket) { - mem_gc_free(interp, bucket->key); - func(bucket->value); - bucket = bucket->next; - } - } - + parrot_hash_iterate(hash, + mem_gc_free(interp, _bucket->value); + ); parrot_hash_destroy(interp, hash); } -- 1.7.1