From 102ed8b661e6ca66d754de0d102713d930fb224d Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 27 Nov 2021 22:29:11 +0100 Subject: Code cleanup --- lib/room.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/room.cpp b/lib/room.cpp index 8f430ccd..6e6d7f11 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -228,12 +228,11 @@ public: QVector stateEventsOfType(const QString& evtType) const { - QVector vals = QVector(); - for (const auto* val : currentState) { - if (val->matrixType() == evtType) { - vals.append(val); - } - } + auto vals = QVector(); + for (auto it = currentState.cbegin(); it != currentState.cend(); ++it) + if (it.key().first == evtType) + vals.append(it.value()); + return vals; } -- cgit v1.2.3