summary refs log tree commit diff
path: root/src/events
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-28 20:46:34 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-28 20:46:34 +0300
commitc18a49915b4b98ac7f837a1feca3e243ac44940d (patch)
tree98fda5a56640689bebf7b6294722f4151731a156 /src/events
parentClean up headers (diff)
downloadnheko-c18a49915b4b98ac7f837a1feca3e243ac44940d.tar.xz
Save the changes between syncs in cache
- Fixes high cpu issues caused by the serialization of the whole
  in-memory state.
- Display name changes are now visible in the timeline.
Diffstat (limited to 'src/events')
-rw-r--r--src/events/PowerLevelsEventContent.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/events/PowerLevelsEventContent.cc b/src/events/PowerLevelsEventContent.cc

index 02a6ee71..c796f81f 100644 --- a/src/events/PowerLevelsEventContent.cc +++ b/src/events/PowerLevelsEventContent.cc
@@ -54,14 +54,14 @@ PowerLevelsEventContent::deserialize(const QJsonValue &data) if (object.value("users").isObject()) { auto users = object.value("users").toObject(); - for (auto it = users.constBegin(); it != users.constEnd(); it++) + for (auto it = users.constBegin(); it != users.constEnd(); ++it) users_.insert(it.key(), it.value().toInt()); } if (object.value("events").isObject()) { auto events = object.value("events").toObject(); - for (auto it = events.constBegin(); it != events.constEnd(); it++) + for (auto it = events.constBegin(); it != events.constEnd(); ++it) events_.insert(it.key(), it.value().toInt()); } } @@ -83,10 +83,10 @@ PowerLevelsEventContent::serialize() const QJsonObject users; QJsonObject events; - for (auto it = users_.constBegin(); it != users_.constEnd(); it++) + for (auto it = users_.constBegin(); it != users_.constEnd(); ++it) users.insert(it.key(), it.value()); - for (auto it = events_.constBegin(); it != events_.constEnd(); it++) + for (auto it = events_.constBegin(); it != events_.constEnd(); ++it) events.insert(it.key(), it.value()); object["users"] = users;