summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-02 11:31:24 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-02 11:31:24 (GMT)
commita8e8ee55ddba5d993821d5143ccda6bf63cd66a8 (patch)
tree2a36293aca65ea2e2c2dfab5758aee61622b2bf2
parentf7aab82001798742d60224c2a3fc75b5369fa799 (diff)
Minor optimization
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index 6d7e402..998b175 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -2029,12 +2029,13 @@ Viewer::DisplayFormatMessage translateToDisplayFormat(MimeTreeParser::Util::Html
void ViewerPrivate::slotToggleHtmlMode()
{
const auto availableModes = mColorBar->availableModes();
- if (mColorBar->isNormal() || availableModes.size() < 2) {
+ const int availableModeSize(availableModes.size());
+ if (mColorBar->isNormal() || availableModeSize < 2) {
return;
}
mScamDetectionWarning->setVisible(false);
const MimeTreeParser::Util::HtmlMode mode = mColorBar->mode();
- const int pos = (availableModes.indexOf(mode) + 1) % availableModes.size();
+ const int pos = (availableModes.indexOf(mode) + 1) % availableModeSize;
setDisplayFormatMessageOverwrite(translateToDisplayFormat(availableModes[pos]));
update(MimeTreeParser::Force);
}