aboutsummaryrefslogtreecommitdiff
path: root/lib/syncdata.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-07-14 14:31:20 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-07-14 14:31:20 +0200
commit8dcb1868adc022efe3fde1fdb99fef2b6634c82c (patch)
treee9b4f0d00039110e8ac485b8d281fd1dc06a025c /lib/syncdata.cpp
parenta83ec9004f52074ba43c17c1113f05db55584067 (diff)
downloadlibquotient-8dcb1868adc022efe3fde1fdb99fef2b6634c82c.tar.gz
libquotient-8dcb1868adc022efe3fde1fdb99fef2b6634c82c.zip
SyncData::parseJson(): fix incorrect reserve() arg
That is unlikely to impact performance, since reserve() is usually called only once per given JSON object (`{ "join": { ... } }`).
Diffstat (limited to 'lib/syncdata.cpp')
-rw-r--r--lib/syncdata.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/syncdata.cpp b/lib/syncdata.cpp
index e6472e18..d0827ea4 100644
--- a/lib/syncdata.cpp
+++ b/lib/syncdata.cpp
@@ -192,7 +192,7 @@ void SyncData::parseJson(const QJsonObject& json, const QString& baseDir)
for (size_t i = 0; i < JoinStateStrings.size(); ++i, ii <<= 1) {
const auto rs = rooms.value(JoinStateStrings[i]).toObject();
// We have a Qt container on the right and an STL one on the left
- roomData.reserve(static_cast<size_t>(rs.size()));
+ roomData.reserve(roomData.size() + static_cast<size_t>(rs.size()));
for (auto roomIt = rs.begin(); roomIt != rs.end(); ++roomIt) {
auto roomJson =
roomIt->isObject()