From 91bdbb61eccdde5e1c228281f7335685b22aa7f6 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 4 Jul 2023 07:58:41 +0200 Subject: [PATCH] AutoTest: Avoid some snapshot copies Change-Id: Idc57027029c0f399a031bc716b9cba731cb34590 Reviewed-by: David Schulz --- src/plugins/autotest/qtest/qttestvisitors.h | 4 ++-- src/plugins/autotest/quick/quicktestvisitors.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/autotest/qtest/qttestvisitors.h b/src/plugins/autotest/qtest/qttestvisitors.h index 608008750dc..756ba17b9e2 100644 --- a/src/plugins/autotest/qtest/qttestvisitors.h +++ b/src/plugins/autotest/qtest/qttestvisitors.h @@ -34,7 +34,7 @@ public: private: CppEditor::SymbolFinder m_symbolFinder; QString m_className; - CPlusPlus::Snapshot m_snapshot; + const CPlusPlus::Snapshot &m_snapshot; QMap m_privSlots; bool m_valid = false; bool m_inherited = false; @@ -55,7 +55,7 @@ private: QStringList m_classNames; CPlusPlus::Scope *m_currentScope = nullptr; CPlusPlus::Document::Ptr m_currentDoc; - CPlusPlus::Snapshot m_snapshot; + const CPlusPlus::Snapshot &m_snapshot; }; class TestDataFunctionVisitor : public CPlusPlus::ASTVisitor diff --git a/src/plugins/autotest/quick/quicktestvisitors.h b/src/plugins/autotest/quick/quicktestvisitors.h index 71d4b91496f..58dae69e921 100644 --- a/src/plugins/autotest/quick/quicktestvisitors.h +++ b/src/plugins/autotest/quick/quicktestvisitors.h @@ -45,7 +45,7 @@ public: private: QmlJS::Document::Ptr m_currentDoc; - QmlJS::Snapshot m_snapshot; + const QmlJS::Snapshot &m_snapshot; QStack m_caseParseStack; QVector m_testCases; QStack m_objectIsTestStack; @@ -64,7 +64,7 @@ public: private: QString m_testBaseName; CPlusPlus::Document::Ptr m_currentDoc; - CPlusPlus::Snapshot m_snapshot; + const CPlusPlus::Snapshot &m_snapshot; }; } // namespace Internal