Don't mix iterator and const_iterator

This avoids unnecessary detaches of the Qt container data.
The mismatches where detected by defining QT_STRICT_ITERATORS;
however, this define violates the ODR (causing linker errors),
and therefore is not added permanently.

Change-Id: Idd336a9c8b394214a820437ef1b92d2101f6101c
GPush-Base: 62b0848b9c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Kai Koehne
2015-04-01 11:19:32 +02:00
parent 87e01423c9
commit 46fc33d914
23 changed files with 48 additions and 46 deletions

View File

@@ -1850,8 +1850,8 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
cleanFilePath.clear();
const QString base = FileName::fromString(fileName).fileName();
QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.find(base);
while (jt != m_baseNameToFullName.end() && jt.key() == base) {
QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.constFind(base);
while (jt != m_baseNameToFullName.constEnd() && jt.key() == base) {
// FIXME: Use some heuristics to find the "best" match.
return jt.value();
//++jt;
@@ -4018,7 +4018,7 @@ bool GdbEngine::handleCliDisassemblerResult(const QByteArray &output, Disassembl
currentFunction = -1;
DisassemblerLines result;
result.setBytesLength(dlines.bytesLength());
for (LineMap::const_iterator it = lineMap.begin(), et = lineMap.end(); it != et; ++it) {
for (LineMap::const_iterator it = lineMap.constBegin(), et = lineMap.constEnd(); it != et; ++it) {
LineData d = *it;
if (d.function != currentFunction) {
if (d.function != -1) {