summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-14 21:40:21 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-14 21:40:21 (GMT)
commitbe6f0d08832394a1574bf8ee2e477676c2fc2b5e (patch)
tree54da15a52c2a176e2b3595b24f53cb704972dd62
parentf1ae373b4d74499936d584f71b564378a4eacdae (diff)
Minor optimization
-rw-r--r--mimetreeparser/src/bodyformatter/utils.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/mimetreeparser/src/bodyformatter/utils.cpp b/mimetreeparser/src/bodyformatter/utils.cpp
index a860b4b..dd396ba 100644
--- a/mimetreeparser/src/bodyformatter/utils.cpp
+++ b/mimetreeparser/src/bodyformatter/utils.cpp
@@ -53,14 +53,11 @@ KMime::Content *MimeTreeParser::findTypeInDirectChilds(KMime::Content *content,
MessagePart::Ptr MimeTreeParser::toplevelTextNode(MessagePart::Ptr messageTree)
{
foreach (const auto &mp, messageTree->subParts()) {
- const auto m = mp.dynamicCast<MessagePart>();
- const auto text = mp.dynamicCast<TextMessagePart>();
- const auto alternative = mp.dynamicCast<AlternativeMessagePart>();
- if (text) {
+ if (const auto text = mp.dynamicCast<TextMessagePart>()) {
return text;
- } else if (alternative) {
+ } else if (const auto alternative = mp.dynamicCast<AlternativeMessagePart>()) {
return alternative;
- } else if (m) {
+ } else if (const auto m = mp.dynamicCast<MessagePart>()) {
auto ret = toplevelTextNode(m);
if (ret) {
return ret;