From b31e74d9f64ed24592cd2c28ba28dbeea100de7c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 19 Mar 2021 04:59:28 +0100 Subject: [PATCH] Reserve memory for rooms in completer --- src/RoomsModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/RoomsModel.cpp b/src/RoomsModel.cpp index 1c3085ea..28ffb6e1 100644 --- a/src/RoomsModel.cpp +++ b/src/RoomsModel.cpp @@ -15,6 +15,10 @@ RoomsModel::RoomsModel(bool showOnlyRoomWithAliases, QObject *parent) { std::vector rooms_ = cache::joinedRooms(); roomInfos = cache::getRoomInfo(rooms_); + if (!showOnlyRoomWithAliases_) { + roomids.reserve(rooms_.size()); + roomAliases.reserve(rooms_.size()); + } for (const auto &r : rooms_) { auto roomAliasesList = cache::client()->getRoomAliases(r);