summaryrefslogtreecommitdiff
path: root/ghash.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-11-28 01:54:54 +0000
committerTim Janik <timj@src.gnome.org>1998-11-28 01:54:54 +0000
commite666e8125f823c75ab0a89e68d73773f24542947 (patch)
treeb9272b5c48ea7616102a76df7b69b152297e2de5 /ghash.c
parent3a14f25fdfa715f1a79b74bcf3916885053ff307 (diff)
implemented incremental freezing facility.
Sat Nov 28 01:23:25 1998 Tim Janik <timj@gtk.org> * ghash.c: implemented incremental freezing facility.
Diffstat (limited to 'ghash.c')
-rw-r--r--ghash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ghash.c b/ghash.c
index 0ff5a2415..4ab82b3fa 100644
--- a/ghash.c
+++ b/ghash.c
@@ -36,7 +36,7 @@ struct _GHashTable
{
gint size;
gint nnodes;
- gint frozen;
+ guint frozen;
GHashNode **nodes;
GHashFunc hash_func;
GCompareFunc key_compare_func;
@@ -207,7 +207,7 @@ g_hash_table_freeze (GHashTable *hash_table)
{
g_return_if_fail (hash_table != NULL);
- hash_table->frozen = TRUE;
+ hash_table->frozen++;
}
void
@@ -215,9 +215,9 @@ g_hash_table_thaw (GHashTable *hash_table)
{
g_return_if_fail (hash_table != NULL);
- hash_table->frozen = FALSE;
-
- g_hash_table_resize (hash_table);
+ if (hash_table->frozen)
+ if (!(--hash_table->frozen))
+ g_hash_table_resize (hash_table);
}
gint