summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-14 05:55:31 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-14 05:55:31 (GMT)
commit8a47f3d7cf44466e38fe9d01964a356f338bf6ff (patch)
tree8035f68ae5ced119b84bed77971d029973270826
parent22a3130eba1762fadead33c2067bf9ae25e9e0e2 (diff)
Minor optimization
-rw-r--r--agents/maildispatcher/outboxqueue.cpp5
-rw-r--r--agents/newmailnotifier/newmailnotifieragent.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/agents/maildispatcher/outboxqueue.cpp b/agents/maildispatcher/outboxqueue.cpp
index 7a2c2cf..a359e82 100644
--- a/agents/maildispatcher/outboxqueue.cpp
+++ b/agents/maildispatcher/outboxqueue.cpp
@@ -421,11 +421,12 @@ bool OutboxQueue::isEmpty() const
int OutboxQueue::count() const
{
- if (d->queue.count() == 0) {
+ const int numberOfElement(d->queue.count());
+ if (numberOfElement == 0) {
// TODO Is this asking for too much?
Q_ASSERT(d->totalSize == 0);
}
- return d->queue.count();
+ return numberOfElement;
}
qulonglong OutboxQueue::totalSize() const
diff --git a/agents/newmailnotifier/newmailnotifieragent.cpp b/agents/newmailnotifier/newmailnotifieragent.cpp
index 741abd0..94fff59 100644
--- a/agents/newmailnotifier/newmailnotifieragent.cpp
+++ b/agents/newmailnotifier/newmailnotifieragent.cpp
@@ -434,10 +434,11 @@ void NewMailNotifierAgent::slotShowNotifications()
}
if (hasUniqMessage) {
- if (it.value().count() == 0) {
+ const int numberOfValue(it.value().count());
+ if (numberOfValue == 0) {
//You can have an unique folder with 0 message
return;
- } else if (it.value().count() == 1) {
+ } else if (numberOfValue == 1) {
item = it.value().at(0);
currentPath = displayName;
break;