diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-09-12 11:12:37 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-09-12 11:12:37 +0900 |
commit | 944653463fe4134c82d85e2d01e2bc0fa43fd727 (patch) | |
tree | c035e1b2a0b7b5491cbd21d2313e2157066482d4 /lib/room.cpp | |
parent | 473686bf953aa8726c7b747935d260be5d9f8ba1 (diff) | |
download | libquotient-944653463fe4134c82d85e2d01e2bc0fa43fd727.tar.gz libquotient-944653463fe4134c82d85e2d01e2bc0fa43fd727.zip |
Introduce HashQ<> and UnorderedMap<>
Invading into std:: is frowned upon, even though legitimate from the C++ standard perspective. Given that it's possible to pass a hash object to unordered_map, it only takes an alias for std::unordered_map to avoid having to specialize std::hash. And besides, a generic compatibility bridge between qHash and std::hash has been long needed.
std::hash<QString> in converters.h remains for now; it will be dropped separately when the API files get regenerated to use UnorderedMap.
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 2c9fca63..2f697589 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -98,7 +98,7 @@ public: RoomSummary summary = { none, 0, none }; /// The state of the room at timeline position before-0 /// \sa timelineBase - std::unordered_map<StateEventKey, StateEventPtr> baseState; + UnorderedMap<StateEventKey, StateEventPtr> baseState; /// State event stubs - events without content, just type and state key static decltype(baseState) stubbedState; /// The state of the room at timeline position after-maxTimelineIndex() @@ -131,7 +131,7 @@ public: QHash<const User*, QString> lastReadEventIds; QString serverReadMarker; TagsMap tags; - std::unordered_map<QString, EventPtr> accountData; + UnorderedMap<QString, EventPtr> accountData; QString prevBatch; QPointer<GetRoomEventsJob> eventsHistoryJob; QPointer<GetMembersByRoomJob> allMembersJob; |