Reserve memory for rooms in completer

This commit is contained in:
Nicolas Werner 2021-03-19 04:59:28 +01:00
parent 0e60c09b19
commit b31e74d9f6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -15,6 +15,10 @@ RoomsModel::RoomsModel(bool showOnlyRoomWithAliases, QObject *parent)
{
std::vector<std::string> 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);