forked from qt-creator/qt-creator
Avoid unnecessary string and list copies
Change-Id: I78bc4d307be69ce3bbfaa3ca3dd7c85e654af8d6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -38,7 +38,7 @@ QByteArray FastPreprocessor::run(Document::Ptr newDoc,
|
||||
mergeEnvironment(i.key());
|
||||
}
|
||||
|
||||
const QList<Document::Include> includes = doc->resolvedIncludes();
|
||||
const QList<Document::Include> &includes = doc->resolvedIncludes();
|
||||
for (const Document::Include &i : includes)
|
||||
mergeEnvironment(i.resolvedFileName());
|
||||
|
||||
@@ -69,7 +69,7 @@ void FastPreprocessor::mergeEnvironment(const FilePath &filePath)
|
||||
{
|
||||
if (Utils::insert(_merged, filePath)) {
|
||||
if (Document::Ptr doc = _snapshot.document(filePath)) {
|
||||
const QList<Document::Include> includes = doc->resolvedIncludes();
|
||||
const QList<Document::Include> &includes = doc->resolvedIncludes();
|
||||
for (const Document::Include &i : includes)
|
||||
mergeEnvironment(i.resolvedFileName());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user