diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-07-30 08:12:09 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-07-30 08:12:09 +0200 |
commit | 02eac9e9ff573d85677f900288e82473f5296ee3 (patch) | |
tree | 22e857b23a150fb57b9f1853ef455fc055fef5f0 /lib/room.cpp | |
parent | e0d9125de7ac132c2a54152015687abbe5e73193 (diff) | |
download | libquotient-02eac9e9ff573d85677f900288e82473f5296ee3.tar.gz libquotient-02eac9e9ff573d85677f900288e82473f5296ee3.zip |
Use a better type in makeRedacted
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index f223e0b9..47a0ec94 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2127,7 +2127,7 @@ RoomEventPtr makeRedacted(const RoomEvent& target, QStringLiteral("membership") }; // clang-format on - std::vector<std::pair<event_type_t, QStringList>> keepContentKeysMap { + static const std::pair<event_type_t, QStringList> keepContentKeysMap[] { { RoomMemberEvent::typeId(), { QStringLiteral("membership") } }, { RoomCreateEvent::typeId(), { QStringLiteral("creator") } }, { RoomPowerLevelsEvent::typeId(), @@ -2146,9 +2146,9 @@ RoomEventPtr makeRedacted(const RoomEvent& target, ++it; } auto keepContentKeys = - find_if(keepContentKeysMap.begin(), keepContentKeysMap.end(), + find_if(begin(keepContentKeysMap), end(keepContentKeysMap), [&target](const auto& t) { return target.type() == t.first; }); - if (keepContentKeys == keepContentKeysMap.end()) { + if (keepContentKeys == end(keepContentKeysMap)) { originalJson.remove(ContentKeyL); originalJson.remove(PrevContentKeyL); } else { |