aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/jobs/{{base}}.cpp.mustache10
-rw-r--r--lib/jobs/{{base}}.h.mustache2
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/jobs/{{base}}.cpp.mustache b/lib/jobs/{{base}}.cpp.mustache
index e44e6a2a..87205caa 100644
--- a/lib/jobs/{{base}}.cpp.mustache
+++ b/lib/jobs/{{base}}.cpp.mustache
@@ -19,9 +19,9 @@ namespace QMatrixClient
}
}
-{{qualifiedName}} FromJson<{{qualifiedName}}>::operator()(QJsonValue jv)
+{{qualifiedName}} FromJson<{{qualifiedName}}>::operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
{{qualifiedName}} result;
{{#vars}}result.{{nameCamelCase}} =
fromJson<{{dataType.name}}>(o.value("{{baseName}}"));
@@ -43,12 +43,12 @@ namespace QMatrixClient
template <> struct FromJson<{{qualifiedName}}>
{
- {{qualifiedName}} operator()(QJsonValue jv)
+ {{qualifiedName}} operator()(const QJsonValue& jv)
{
- QJsonObject o = jv.toObject();
+ const auto& o = jv.toObject();
{{qualifiedName}} result;
{{#vars}}result.{{nameCamelCase}} =
- fromJson<{{dataType.qualifiedName}}>(o.value("{{baseName}}"));
+ fromJson<{{dataType.qualifiedName}}>(o.value("{{baseName}}"));
{{/vars}}
return result;
}
diff --git a/lib/jobs/{{base}}.h.mustache b/lib/jobs/{{base}}.h.mustache
index 8606e251..941662de 100644
--- a/lib/jobs/{{base}}.h.mustache
+++ b/lib/jobs/{{base}}.h.mustache
@@ -23,7 +23,7 @@ namespace QMatrixClient
template <> struct FromJson<{{name}}>
{
- {{name}} operator()(QJsonValue jv);
+ {{name}} operator()(const QJsonValue& jv);
};
{{/ trivial?}}{{/model}}
{{/models}}{{#operations}} // Operations