aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlformat
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2023-09-14 12:30:33 +0200
committerUlf Hermann <[email protected]>2023-09-15 15:32:40 +0200
commit27dcc63e00a764b1abe49a4fdf7ee452f2f609f9 (patch)
tree0a77f0fe9e9b583e2ce52ef81c97f32ac8e8b648 /tools/qmlformat
parent8de468ed2a7fec573d2bfe0887816d2c8a2d07d4 (diff)
QmlDom: Don't pass ErrorMessage by value
When iterating, pass it by const ref. When "adding" pass it by rvalue ref. In the few places where that clashes, copy it explicitly. Coverity-Id: 417092 Change-Id: I93b2d671c38a2f44334929fd7ec9c2f1a18caac8 Reviewed-by: Sami Shalayel <[email protected]>
Diffstat (limited to 'tools/qmlformat')
-rw-r--r--tools/qmlformat/qmlformat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/qmlformat/qmlformat.cpp b/tools/qmlformat/qmlformat.cpp
index 68dd7c5379..42c11670f8 100644
--- a/tools/qmlformat/qmlformat.cpp
+++ b/tools/qmlformat/qmlformat.cpp
@@ -65,7 +65,7 @@ bool parseFile(const QString &filename, const Options &options)
std::shared_ptr<QmlFile> qmlFilePtr = qmlFile.ownerAs<QmlFile>();
if (!qmlFilePtr || !qmlFilePtr->isValid()) {
qmlFile.iterateErrors(
- [](DomItem, ErrorMessage msg) {
+ [](const DomItem &, const ErrorMessage &msg) {
errorToQDebug(msg);
return true;
},