diff options
author | Tim Janik <timj@gtk.org> | 1998-11-28 01:54:54 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-11-28 01:54:54 +0000 |
commit | e666e8125f823c75ab0a89e68d73773f24542947 (patch) | |
tree | b9272b5c48ea7616102a76df7b69b152297e2de5 /ghash.c | |
parent | 3a14f25fdfa715f1a79b74bcf3916885053ff307 (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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |