Commit 474a2b1d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent 6d544f0c
......@@ -127,7 +127,8 @@ void AgentSearchInterface::searchFinished(const ImapSet &result, ResultScope sco
if (scope == Akonadi::AgentSearchInterface::Rid) {
QVector<QByteArray> rids;
Q_FOREACH (const ImapInterval &interval, result.intervals()) {
for (int i = interval.begin(); i <= interval.end(); ++i) {
const int endInterval(interval.end());
for (int i = interval.begin(); i <= endInterval; ++i) {
rids << QByteArray::number(i);
}
}
......
......@@ -624,7 +624,8 @@ QString ResourceScheduler::dumpToString() const
str << " queue " << i << " is empty" << endl;
} else {
str << " queue " << i << " " << queue.size() << " tasks:" << endl;
for (QList<Task>::const_iterator it = queue.begin(); it != queue.end(); ++it) {
QList<Task>::const_iterator queueEnd(queue.constEnd());
for (QList<Task>::const_iterator it = queue.constBegin(); it != queueEnd; ++it) {
str << " " << (*it) << endl;
}
}
......
......@@ -75,8 +75,9 @@ void CollectionModifyJob::doStart()
if (d->mCollection.parentCollection().id() >= 0) {
cmd.setParentId(d->mCollection.parentCollection().id());
}
if (!d->mCollection.name().isEmpty()) {
cmd.setName(d->mCollection.name());
const QString &collectionName = d->mCollection.name();
if (!collectionName.isEmpty()) {
cmd.setName(collectionName);
}
if (!d->mCollection.remoteId().isNull()) {
cmd.setRemoteId(d->mCollection.remoteId());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment