aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/{{base}}.cpp.mustache
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jobs/{{base}}.cpp.mustache')
-rw-r--r--lib/jobs/{{base}}.cpp.mustache10
1 files changed, 5 insertions, 5 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;
}