diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-07-16 03:18:10 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-07-18 00:08:46 +0800 |
commit | 99d026acbef48f4e7a574ffe2382bb54b380d4a2 (patch) | |
tree | 4855e7dbc0b54a8101bec10c9ef0e3ad936ae854 | |
parent | 060bb076625dba3aad86485014d49a348cf13671 (diff) | |
download | gsoc2013-evolution-99d026acbef48f4e7a574ffe2382bb54b380d4a2.tar.gz gsoc2013-evolution-99d026acbef48f4e7a574ffe2382bb54b380d4a2.tar.zst gsoc2013-evolution-99d026acbef48f4e7a574ffe2382bb54b380d4a2.zip |
MailFolderCache: Remove unnecessary "stores" checks.
The "stores" hash table is created on instance init and destroyed with
the cache itself. It is never NULL during MailFolderCache's lifetime.
-rw-r--r-- | libemail-engine/mail-folder-cache.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c index 6f469ddaa6..b2433768e9 100644 --- a/libemail-engine/mail-folder-cache.c +++ b/libemail-engine/mail-folder-cache.c @@ -498,8 +498,7 @@ folder_changed_cb (CamelFolder *folder, GINT_TO_POINTER (new_latest_received)); g_rec_mutex_lock (&cache->priv->stores_mutex); - if (cache->priv->stores != NULL - && (si = g_hash_table_lookup (cache->priv->stores, parent_store)) != NULL + if ((si = g_hash_table_lookup (cache->priv->stores, parent_store)) != NULL && (mfi = g_hash_table_lookup (si->folders, full_name)) != NULL && mfi->folder == folder) { update_1folder (cache, mfi, new, uid, sender, subject, NULL); @@ -1570,8 +1569,7 @@ mail_folder_cache_note_folder (MailFolderCache *cache, parent_store = camel_folder_get_parent_store (folder); g_rec_mutex_lock (&cache->priv->stores_mutex); - if (cache->priv->stores == NULL - || (si = g_hash_table_lookup (cache->priv->stores, parent_store)) == NULL + if ((si = g_hash_table_lookup (cache->priv->stores, parent_store)) == NULL || (mfi = g_hash_table_lookup (si->folders, full_name)) == NULL) { w (g_warning ("Noting folder before store initialised")); g_rec_mutex_unlock (&cache->priv->stores_mutex); @@ -1623,9 +1621,6 @@ mail_folder_cache_has_folder_info (MailFolderCache *cache, g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE); g_return_val_if_fail (folder_name != NULL, FALSE); - if (cache->priv->stores == NULL) - return FALSE; - g_rec_mutex_lock (&cache->priv->stores_mutex); si = g_hash_table_lookup (cache->priv->stores, store); if (si != NULL) @@ -1663,9 +1658,6 @@ mail_folder_cache_ref_folder (MailFolderCache *cache, g_return_val_if_fail (CAMEL_IS_STORE (store), NULL); g_return_val_if_fail (folder_name != NULL, NULL); - if (cache->priv->stores == NULL) - return NULL; - g_rec_mutex_lock (&cache->priv->stores_mutex); si = g_hash_table_lookup (cache->priv->stores, store); if (si != NULL) { @@ -1706,9 +1698,6 @@ mail_folder_cache_get_folder_info_flags (MailFolderCache *cache, g_return_val_if_fail (folder_name != NULL, FALSE); g_return_val_if_fail (flags != NULL, FALSE); - if (cache->priv->stores == NULL) - return FALSE; - g_rec_mutex_lock (&cache->priv->stores_mutex); si = g_hash_table_lookup (cache->priv->stores, store); if (si != NULL) { @@ -1772,9 +1761,6 @@ mail_folder_cache_service_removed (MailFolderCache *cache, g_return_if_fail (MAIL_IS_FOLDER_CACHE (cache)); g_return_if_fail (CAMEL_IS_SERVICE (service)); - if (cache->priv->stores == NULL) - return; - g_rec_mutex_lock (&cache->priv->stores_mutex); si = g_hash_table_lookup (cache->priv->stores, service); |