From a4f34202b47f91f7fdfbe2006b2eae10b9b8eeac Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Thu, 11 Nov 2021 14:35:54 +0100 Subject: Fix a few quirks in converters.h --- lib/converters.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/converters.h b/lib/converters.h index cc6378e4..2df18b03 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -242,12 +242,11 @@ struct JsonObjectConverter> { for (const auto& e : s) json.insert(toJson(e), QJsonObject {}); } - static auto fillFrom(const QJsonObject& json, QSet& s) + static void fillFrom(const QJsonObject& json, QSet& s) { s.reserve(s.size() + json.size()); for (auto it = json.begin(); it != json.end(); ++it) s.insert(it.key()); - return s; } }; @@ -260,7 +259,7 @@ struct HashMapFromJson { } static void fillFrom(const QJsonObject& jo, HashMapT& h) { - h.reserve(jo.size()); + h.reserve(h.size() + jo.size()); for (auto it = jo.begin(); it != jo.end(); ++it) h[it.key()] = fromJson(it.value()); } -- cgit v1.2.3