Use prefix instead of postfix for iterators
The postfix increment(decrement) creates a temp copy of *this before the modification and then returns that copy. It's needed only when using the old iterator and then incrementing it. Change-Id: I7f6702de78f5f987cec3556047e76049b4ee063a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
163b852951
commit
c2f26d6d0b
@ -781,7 +781,7 @@ static QStringList fallbackFamilies(const QString &family, QFont::Style style, Q
|
|||||||
}
|
}
|
||||||
if (!contains) {
|
if (!contains) {
|
||||||
i = retList.erase(i);
|
i = retList.erase(i);
|
||||||
i--;
|
--i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retList;
|
return retList;
|
||||||
|
@ -2084,7 +2084,7 @@ QFontEngine *QFontEngineMulti::createMultiFontEngine(QFontEngine *fe, int script
|
|||||||
fc->updateHitCountAndTimeStamp(it.value());
|
fc->updateHitCountAndTimeStamp(it.value());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
it++;
|
++it;
|
||||||
}
|
}
|
||||||
if (!engine) {
|
if (!engine) {
|
||||||
engine = QGuiApplicationPrivate::instance()->platformIntegration()->fontDatabase()->fontEngineMulti(fe, QChar::Script(script));
|
engine = QGuiApplicationPrivate::instance()->platformIntegration()->fontDatabase()->fontEngineMulti(fe, QChar::Script(script));
|
||||||
|
@ -278,7 +278,7 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
|
|||||||
writer.writeStartElement(textNS, QString::fromLatin1("p"));
|
writer.writeStartElement(textNS, QString::fromLatin1("p"));
|
||||||
writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1")
|
writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1")
|
||||||
.arg(block.blockFormatIndex()));
|
.arg(block.blockFormatIndex()));
|
||||||
for (QTextBlock::Iterator frag= block.begin(); !frag.atEnd(); frag++) {
|
for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) {
|
||||||
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it.
|
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it.
|
||||||
writer.writeStartElement(textNS, QString::fromLatin1("span"));
|
writer.writeStartElement(textNS, QString::fromLatin1("span"));
|
||||||
|
|
||||||
|
@ -307,11 +307,12 @@ bool QNetworkCookieJar::deleteCookie(const QNetworkCookie &cookie)
|
|||||||
{
|
{
|
||||||
Q_D(QNetworkCookieJar);
|
Q_D(QNetworkCookieJar);
|
||||||
QList<QNetworkCookie>::Iterator it;
|
QList<QNetworkCookie>::Iterator it;
|
||||||
for (it = d->allCookies.begin(); it != d->allCookies.end(); it++)
|
for (it = d->allCookies.begin(); it != d->allCookies.end(); ++it) {
|
||||||
if (it->hasSameIdentifier(cookie)) {
|
if (it->hasSameIdentifier(cookie)) {
|
||||||
d->allCookies.erase(it);
|
d->allCookies.erase(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ QByteArray QSslKeyPrivate::pemFromDer(const QByteArray &der, const QMap<QByteArr
|
|||||||
if (!headers.isEmpty()) {
|
if (!headers.isEmpty()) {
|
||||||
QMap<QByteArray, QByteArray>::const_iterator it = headers.constEnd();
|
QMap<QByteArray, QByteArray>::const_iterator it = headers.constEnd();
|
||||||
do {
|
do {
|
||||||
it--;
|
--it;
|
||||||
extra += it.key() + ": " + it.value() + '\n';
|
extra += it.key() + ": " + it.value() + '\n';
|
||||||
} while (it != headers.constBegin());
|
} while (it != headers.constBegin());
|
||||||
extra += '\n';
|
extra += '\n';
|
||||||
|
@ -501,9 +501,10 @@ bool QSqlTableModel::isDirty() const
|
|||||||
Q_D(const QSqlTableModel);
|
Q_D(const QSqlTableModel);
|
||||||
QSqlTableModelPrivate::CacheMap::ConstIterator i = d->cache.constBegin();
|
QSqlTableModelPrivate::CacheMap::ConstIterator i = d->cache.constBegin();
|
||||||
const QSqlTableModelPrivate::CacheMap::ConstIterator e = d->cache.constEnd();
|
const QSqlTableModelPrivate::CacheMap::ConstIterator e = d->cache.constEnd();
|
||||||
for (; i != e; i++)
|
for (; i != e; ++i) {
|
||||||
if (!i.value().submitted())
|
if (!i.value().submitted())
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user