From 8be1058a8b00d1ada767e646be43329d2801a2e0 Mon Sep 17 00:00:00 2001
From: luben <karavelov@spnet.net>
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
|
b
|
|
| 1115 | 1115 | parrot_chash_destroy_values(PARROT_INTERP, ARGMOD(Hash *hash), NOTNULL(value_free func)) |
| 1116 | 1116 | { |
| 1117 | 1117 | ASSERT_ARGS(parrot_chash_destroy_values) |
| 1118 | | UINTVAL i; |
| 1119 | | |
| 1120 | | for (i = 0; i <= hash->mask; ++i) { |
| 1121 | | HashBucket *bucket = hash->index[i]; |
| 1122 | | while (bucket) { |
| 1123 | | mem_gc_free(interp, bucket->key); |
| 1124 | | func(bucket->value); |
| 1125 | | bucket = bucket->next; |
| 1126 | | } |
| 1127 | | } |
| 1128 | | |
| | 1118 | parrot_hash_iterate(hash, |
| | 1119 | mem_gc_free(interp, _bucket->value); |
| | 1120 | ); |
| 1129 | 1121 | parrot_hash_destroy(interp, hash); |
| 1130 | 1122 | } |
| 1131 | 1123 | |