aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-08-07 09:41:31 +0200
committerUlf Hermann <ulf.hermann@qt.io>2025-08-07 21:32:01 +0200
commit992ca8c4ef1ce4294e5df9c7ca5a73cb8db135f6 (patch)
tree2dbceca276fc8270bcd8990c055aa3884798a53d /src
parent64a5549032eb323e0fc98a366fa9a99cdb1b907f (diff)
QmlCompiler: Pass QQmlJSSaveFunction as const ref
std::function is quite heavy-weight. Coverity-Id: 486648 Change-Id: Ia7c61a726bde9c9d6a02412b9aa5f683bb4d355a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp8
-rw-r--r--src/qmlcompiler/qqmljscompiler_p.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index e910d93035..1efcefcfc4 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -169,7 +169,7 @@ private:
const QmlIR::Function *m_function = nullptr;
};
-bool qCompileQmlFile(const QString &inputFileName, QQmlJSSaveFunction saveFunction,
+bool qCompileQmlFile(const QString &inputFileName, const QQmlJSSaveFunction &saveFunction,
QQmlJSAotCompiler *aotCompiler, QQmlJSCompileError *error,
bool storeSourceLocation, QV4::Compiler::CodegenWarningInterface *wInterface,
const QString *fileContents)
@@ -180,7 +180,7 @@ bool qCompileQmlFile(const QString &inputFileName, QQmlJSSaveFunction saveFuncti
}
bool qCompileQmlFile(QmlIR::Document &irDocument, const QString &inputFileName,
- QQmlJSSaveFunction saveFunction, QQmlJSAotCompiler *aotCompiler,
+ const QQmlJSSaveFunction &saveFunction, QQmlJSAotCompiler *aotCompiler,
QQmlJSCompileError *error, bool storeSourceLocation,
QV4::Compiler::CodegenWarningInterface *wInterface, const QString *fileContents)
{
@@ -371,8 +371,8 @@ bool qCompileQmlFile(QmlIR::Document &irDocument, const QString &inputFileName,
}
bool qCompileJSFile(
- const QString &inputFileName, const QString &inputFileUrl, QQmlJSSaveFunction saveFunction,
- QQmlJSCompileError *error)
+ const QString &inputFileName, const QString &inputFileUrl,
+ const QQmlJSSaveFunction &saveFunction, QQmlJSCompileError *error)
{
Q_UNUSED(inputFileUrl);
diff --git a/src/qmlcompiler/qqmljscompiler_p.h b/src/qmlcompiler/qqmljscompiler_p.h
index 51ad2fd4f5..47fa093068 100644
--- a/src/qmlcompiler/qqmljscompiler_p.h
+++ b/src/qmlcompiler/qqmljscompiler_p.h
@@ -116,21 +116,21 @@ using QQmlJSSaveFunction
const QQmlJSAotFunctionMap &, QString *)>;
bool Q_QMLCOMPILER_EXPORT qCompileQmlFile(const QString &inputFileName,
- QQmlJSSaveFunction saveFunction,
+ const QQmlJSSaveFunction &saveFunction,
QQmlJSAotCompiler *aotCompiler, QQmlJSCompileError *error,
bool storeSourceLocation = false,
QV4::Compiler::CodegenWarningInterface *wInterface =
QV4::Compiler::defaultCodegenWarningInterface(),
const QString *fileContents = nullptr);
bool Q_QMLCOMPILER_EXPORT qCompileQmlFile(QmlIR::Document &irDocument, const QString &inputFileName,
- QQmlJSSaveFunction saveFunction,
+ const QQmlJSSaveFunction &saveFunction,
QQmlJSAotCompiler *aotCompiler, QQmlJSCompileError *error,
bool storeSourceLocation = false,
QV4::Compiler::CodegenWarningInterface *wInterface =
QV4::Compiler::defaultCodegenWarningInterface(),
const QString *fileContents = nullptr);
bool Q_QMLCOMPILER_EXPORT qCompileJSFile(const QString &inputFileName, const QString &inputFileUrl,
- QQmlJSSaveFunction saveFunction,
+ const QQmlJSSaveFunction &saveFunction,
QQmlJSCompileError *error);
bool Q_QMLCOMPILER_EXPORT qSaveQmlJSUnitAsCpp(const QString &inputFileName,