aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-subscription-editor.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-01-12 02:00:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-01-12 02:43:19 +0800
commitde978d42317423ceb3041d773913473d564a0ec4 (patch)
tree93caed2beebd7779ae5f6d35669d65cea0146469 /mail/em-subscription-editor.c
parentadc0ad91c4e187d814d41edd69a6c53c6405f235 (diff)
downloadgsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.tar
gsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.tar.gz
gsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.tar.bz2
gsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.tar.lz
gsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.tar.xz
gsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.tar.zst
gsoc2013-evolution-de978d42317423ceb3041d773913473d564a0ec4.zip
Use g_hash_table_add() when using a hash table as a set.
g_hash_table_add(table, key) uses less memory than g_hash_table_insert(table, key, GINT_TO_POINTER (1)). Also use g_hash_table_contains() when testing for membership.
Diffstat (limited to 'mail/em-subscription-editor.c')
-rw-r--r--mail/em-subscription-editor.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index 5a372b9117..69e1271e5f 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -709,9 +709,9 @@ pick_all_cb (GtkTreeModel *model,
if (can_pick_folder_info (tree_row_data->folder_info, data->mode) &&
(data->skip_folder_infos == NULL ||
- !g_hash_table_lookup_extended (
- data->skip_folder_infos,
- tree_row_data->folder_info, NULL, NULL))) {
+ !g_hash_table_contains (
+ data->skip_folder_infos,
+ tree_row_data->folder_info))) {
g_queue_push_tail (data->out_tree_rows, tree_row_data);
} else
tree_row_data_free (tree_row_data);
@@ -912,10 +912,7 @@ subscription_editor_unsubscribe_hidden (EMSubscriptionEditor *editor)
if (tree_row_data == NULL)
continue;
- g_hash_table_insert (
- skip_shown,
- tree_row_data->folder_info,
- GINT_TO_POINTER (1));
+ g_hash_table_add (skip_shown, tree_row_data->folder_info);
tree_row_data_free (tree_row_data);
}