aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/receiptevent.cpp6
-rw-r--r--events/receiptevent.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/events/receiptevent.cpp b/events/receiptevent.cpp
index b36ddb23..e30fe4e4 100644
--- a/events/receiptevent.cpp
+++ b/events/receiptevent.cpp
@@ -56,15 +56,15 @@ ReceiptEvent::ReceiptEvent(const QJsonObject& obj)
continue;
}
const QJsonObject reads = eventIt.value().toObject().value("m.read").toObject();
- std::vector<Receipt> receipts;
- receipts.reserve(static_cast<size_t>(reads.size()));
+ QVector<Receipt> receipts;
+ receipts.reserve(reads.size());
for( auto userIt = reads.begin(); userIt != reads.end(); ++userIt )
{
const QJsonObject user = userIt.value().toObject();
receipts.push_back({userIt.key(),
QMatrixClient::fromJson<QDateTime>(user["ts"])});
}
- _eventsWithReceipts.push_back({eventIt.key(), receipts});
+ _eventsWithReceipts.push_back({eventIt.key(), std::move(receipts)});
}
static const auto UnreadMsgsKey =
QStringLiteral("x-qmatrixclient.unread_messages");
diff --git a/events/receiptevent.h b/events/receiptevent.h
index 15fdf946..9494c7c6 100644
--- a/events/receiptevent.h
+++ b/events/receiptevent.h
@@ -30,9 +30,9 @@ namespace QMatrixClient
struct ReceiptsForEvent
{
QString evtId;
- std::vector<Receipt> receipts;
+ QVector<Receipt> receipts;
};
- using EventsWithReceipts = std::vector<ReceiptsForEvent>;
+ using EventsWithReceipts = QVector<ReceiptsForEvent>;
class ReceiptEvent: public Event
{