mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
Reduce some excessive indentation.
I prefer checking a condition and returning early rather than making large blocks of code within a function conditional.
This commit is contained in:
parent
f744b050b1
commit
2d1356e8db
1 changed files with 16 additions and 15 deletions
|
@ -393,12 +393,14 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out)
|
||||||
INTERNAL_ERROR ("Illegal request to format non-text part (%s) as text.",
|
INTERNAL_ERROR ("Illegal request to format non-text part (%s) as text.",
|
||||||
g_mime_content_type_to_string (content_type));
|
g_mime_content_type_to_string (content_type));
|
||||||
|
|
||||||
charset = g_mime_object_get_content_type_parameter (part, "charset");
|
if (stream_out == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (stream_out) {
|
|
||||||
stream_filter = g_mime_stream_filter_new (stream_out);
|
stream_filter = g_mime_stream_filter_new (stream_out);
|
||||||
g_mime_stream_filter_add(GMIME_STREAM_FILTER (stream_filter),
|
g_mime_stream_filter_add(GMIME_STREAM_FILTER (stream_filter),
|
||||||
g_mime_filter_crlf_new (FALSE, FALSE));
|
g_mime_filter_crlf_new (FALSE, FALSE));
|
||||||
|
|
||||||
|
charset = g_mime_object_get_content_type_parameter (part, "charset");
|
||||||
if (charset) {
|
if (charset) {
|
||||||
GMimeFilter *charset_filter;
|
GMimeFilter *charset_filter;
|
||||||
charset_filter = g_mime_filter_charset_new (charset, "UTF-8");
|
charset_filter = g_mime_filter_charset_new (charset, "UTF-8");
|
||||||
|
@ -409,7 +411,6 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out)
|
||||||
g_mime_stream_filter_add (GMIME_STREAM_FILTER (stream_filter),
|
g_mime_stream_filter_add (GMIME_STREAM_FILTER (stream_filter),
|
||||||
charset_filter);
|
charset_filter);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
wrapper = g_mime_part_get_content_object (GMIME_PART (part));
|
wrapper = g_mime_part_get_content_object (GMIME_PART (part));
|
||||||
if (wrapper && stream_filter)
|
if (wrapper && stream_filter)
|
||||||
|
|
Loading…
Reference in a new issue