diff options
-rw-r--r-- | lib/room.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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<const StateEventBase*> stateEventsOfType(const QString& evtType) const { - QVector<const StateEventBase*> vals = QVector<const StateEventBase*>(); - for (const auto* val : currentState) { - if (val->matrixType() == evtType) { - vals.append(val); - } - } + auto vals = QVector<const StateEventBase*>(); + for (auto it = currentState.cbegin(); it != currentState.cend(); ++it) + if (it.key().first == evtType) + vals.append(it.value()); + return vals; } |