aboutsummaryrefslogtreecommitdiff
path: root/room.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-05-13 16:00:26 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-05-13 16:00:26 +0900
commitc25de4e19801c7931ce857c29a7a48be7f5c4dbe (patch)
tree53722a470324946d5b3662e66cf517adf23ebe14 /room.h
parent63db311d5a64b9942dc69e1b13b4570a548554c0 (diff)
downloadlibquotient-c25de4e19801c7931ce857c29a7a48be7f5c4dbe.tar.gz
libquotient-c25de4e19801c7931ce857c29a7a48be7f5c4dbe.zip
More code cleanup and tweaks; fine-tuning logs; performance improvements
After adding some profiling it became clear that to recalculate the room name and emit namesChanged() upon each member event is a waste, especially when there are thousands of those coming at initial sync (*cough* Matrix HQ room). So the room name is recalculated only once and unconditionally (in most cases this will boil down to checking whether name/canonicalAlias changed after processing the events batch), and namesChanged is only emitted once per batch, if any name or alias changed.
Diffstat (limited to 'room.h')
-rw-r--r--room.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/room.h b/room.h
index 689a99b0..60be33b9 100644
--- a/room.h
+++ b/room.h
@@ -102,7 +102,7 @@ namespace QMatrixClient
*/
Q_INVOKABLE QString roomMembername(const QString& userId) const;
- Q_INVOKABLE void updateData(SyncRoomData& data );
+ void updateData(SyncRoomData&& data );
Q_INVOKABLE void setJoinState( JoinState state );
const Timeline& messageEvents() const;
@@ -116,7 +116,7 @@ namespace QMatrixClient
Q_INVOKABLE bool isValidIndex(TimelineItem::index_t timelineIndex) const;
rev_iter_t findInTimeline(TimelineItem::index_t index) const;
- rev_iter_t findInTimeline(QString evtId) const;
+ rev_iter_t findInTimeline(const QString& evtId) const;
rev_iter_t readMarker(const User* user) const;
rev_iter_t readMarker() const;