diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-11 14:35:54 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-11-12 16:22:06 +0100 |
commit | 05e71a72fdc6da3fb319edc67b723999285c9657 (patch) | |
tree | 282fa9644390c46cb029cde057267c035edcb301 /lib | |
parent | 29195491c25bcba50b78a30c779db07913f87d3a (diff) | |
download | libquotient-05e71a72fdc6da3fb319edc67b723999285c9657.tar.gz libquotient-05e71a72fdc6da3fb319edc67b723999285c9657.zip |
Fix a few quirks in converters.h
Diffstat (limited to 'lib')
-rw-r--r-- | lib/converters.h | 5 |
1 files 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<QSet<QString>> { for (const auto& e : s) json.insert(toJson(e), QJsonObject {}); } - static auto fillFrom(const QJsonObject& json, QSet<QString>& s) + static void fillFrom(const QJsonObject& json, QSet<QString>& 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<typename HashMapT::mapped_type>(it.value()); } |