forked from qt-creator/qt-creator
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:
@@ -521,9 +521,9 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D
|
||||
const QString &fileName = doc->fileName();
|
||||
d->docLocker.lockForRead();
|
||||
ParserTreeItem::ConstPtr item = d->cachedDocTrees.value(fileName);
|
||||
CitCachedDocTreeRevision citCachedDocTreeRevision = d->cachedDocTreesRevision.find(fileName);
|
||||
CitCachedDocTreeRevision citCachedDocTreeRevision = d->cachedDocTreesRevision.constFind(fileName);
|
||||
if (!item.isNull()
|
||||
&& citCachedDocTreeRevision != d->cachedDocTreesRevision.end()
|
||||
&& citCachedDocTreeRevision != d->cachedDocTreesRevision.constEnd()
|
||||
&& citCachedDocTreeRevision.value() == doc->revision()) {
|
||||
d->docLocker.unlock();
|
||||
return item;
|
||||
@@ -759,9 +759,9 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
|
||||
// our own files
|
||||
QStringList fileList;
|
||||
|
||||
CitCachedPrjFileLists cit = d->cachedPrjFileLists.find(nodePath);
|
||||
CitCachedPrjFileLists cit = d->cachedPrjFileLists.constFind(nodePath);
|
||||
// try to improve parsing speed by internal cache
|
||||
if (cit != d->cachedPrjFileLists.end()) {
|
||||
if (cit != d->cachedPrjFileLists.constEnd()) {
|
||||
fileList = cit.value();
|
||||
} else {
|
||||
fileList = projectNodeFileList(node);
|
||||
@@ -800,9 +800,9 @@ QStringList Parser::getAllFiles(const ProjectNode *node)
|
||||
|
||||
const QString nodePath = node->path().toString();
|
||||
|
||||
CitCachedPrjFileLists cit = d->cachedPrjFileLists.find(nodePath);
|
||||
CitCachedPrjFileLists cit = d->cachedPrjFileLists.constFind(nodePath);
|
||||
// try to improve parsing speed by internal cache
|
||||
if (cit != d->cachedPrjFileLists.end()) {
|
||||
if (cit != d->cachedPrjFileLists.constEnd()) {
|
||||
fileList = cit.value();
|
||||
} else {
|
||||
fileList = projectNodeFileList(node);
|
||||
|
||||
Reference in New Issue
Block a user