From: Timo Sirainen Date: Thu, 10 Sep 2020 13:36:14 +0000 (+0300) Subject: lib-storage: index_mail_get_cached_bodystructure() - Reorder the if statements X-Git-Tag: 2.3.13~151 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52a0f91840745874722c674484e40748b350c49f;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: index_mail_get_cached_bodystructure() - Reorder the if statements Simplifies the following commit. --- diff --git a/src/lib-storage/index/index-mail.c b/src/lib-storage/index/index-mail.c index 276c54e69d..4d2398ad00 100644 --- a/src/lib-storage/index/index-mail.c +++ b/src/lib-storage/index/index-mail.c @@ -1548,18 +1548,16 @@ bool index_mail_get_cached_bodystructure(struct index_mail *mail, str = str_new(mail->mail.data_pool, 128); if ((data->cache_flags & MAIL_CACHE_FLAG_TEXT_PLAIN_7BIT_ASCII) != 0 && - get_cached_parts(mail)) { + get_cached_parts(mail)) index_mail_get_plain_bodystructure(mail, str, TRUE); - *value_r = data->bodystructure = str_c(str); - return TRUE; - } - if (index_mail_cache_lookup_field(mail, str, bodystructure_cache_field) > 0) { - *value_r = data->bodystructure = str_c(str); - return TRUE; + else if (index_mail_cache_lookup_field(mail, str, + bodystructure_cache_field) <= 0) { + str_free(&str); + return FALSE; } - str_free(&str); - return FALSE; + *value_r = data->bodystructure = str_c(str); + return TRUE; } int index_mail_get_special(struct mail *_mail,