aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine/e-mail-utils.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 /libemail-engine/e-mail-utils.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 'libemail-engine/e-mail-utils.c')
-rw-r--r--libemail-engine/e-mail-utils.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c
index 30eee6242a..750e8cce51 100644
--- a/libemail-engine/e-mail-utils.c
+++ b/libemail-engine/e-mail-utils.c
@@ -1104,7 +1104,7 @@ mail_account_in_recipients (ESourceRegistry *registry,
g_object_unref (source);
if (address != NULL) {
- match = (g_hash_table_lookup (recipients, address) != NULL);
+ match = g_hash_table_contains (recipients, address);
g_free (address);
}
@@ -1141,9 +1141,7 @@ em_utils_guess_mail_account_with_recipients (ESourceRegistry *registry,
gint index = 0;
while (camel_internet_address_get (addr, index++, NULL, &key))
- g_hash_table_insert (
- recipients, (gpointer) key,
- GINT_TO_POINTER (1));
+ g_hash_table_add (recipients, (gpointer) key);
}
type = CAMEL_RECIPIENT_TYPE_CC;
@@ -1152,9 +1150,7 @@ em_utils_guess_mail_account_with_recipients (ESourceRegistry *registry,
gint index = 0;
while (camel_internet_address_get (addr, index++, NULL, &key))
- g_hash_table_insert (
- recipients, (gpointer) key,
- GINT_TO_POINTER (1));
+ g_hash_table_add (recipients, (gpointer) key);
}
/* First Preference: We were given a folder that maps to an