From afd1742f9fad8d0c675532bf08b20d323221eb99 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 30 Sep 2022 13:17:36 +0200 Subject: [PATCH] CPlusPlus: Limit the usage of qMakePair Change-Id: Ica59c320fb700369e968bb03a93deff34eb7ffb7 Reviewed-by: hjk Reviewed-by: --- src/libs/cplusplus/CppDocument.cpp | 2 +- src/libs/cplusplus/CppRewriter.cpp | 2 +- src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp | 2 +- src/libs/cplusplus/pp-engine.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 561265146d6..6cc7c49da5e 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -792,7 +792,7 @@ QList Snapshot::includeLocationsOfDocument(const QStr const QList includeFiles = doc->resolvedIncludes(); for (const Document::Include &includeFile : includeFiles) { if (includeFile.resolvedFileName() == fileName) - result.append(qMakePair(doc, includeFile.line())); + result.push_back({doc, includeFile.line()}); } } return result; diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp index b980d78dee7..f5873cc71fc 100644 --- a/src/libs/cplusplus/CppRewriter.cpp +++ b/src/libs/cplusplus/CppRewriter.cpp @@ -404,7 +404,7 @@ SubstitutionMap::~SubstitutionMap() void SubstitutionMap::bind(const Name *name, const FullySpecifiedType &ty) { - _map.append(qMakePair(name, ty)); + _map.push_back({name, ty}); } FullySpecifiedType SubstitutionMap::apply(const Name *name, Rewrite *) const diff --git a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp index ebb105f3504..bf14cfe0f21 100644 --- a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp +++ b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp @@ -389,7 +389,7 @@ FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *classN if (templArgName && templArgName->identifier()) { const Identifier *templArgId = templArgName->identifier(); - subst.append(qMakePair(templArgId, templArgTy)); + subst.push_back({templArgId, templArgTy}); } } } diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 7228c446dfe..836e2ad05b7 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -1420,7 +1420,7 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source, trackedLine = tk.lineno; trackedColumn = unsigned(computeDistance(tk, true)); } - m_state.m_expandedTokensInfo.append(qMakePair(trackedLine, trackedColumn)); + m_state.m_expandedTokensInfo.push_back({trackedLine, trackedColumn}); } else if (m_state.m_expansionStatus == JustFinishedExpansion) { m_state.setExpansionStatus(NotExpanding); macroExpanded = true;