From 2c095d29b96393dcfa3121c8cb9f4c4fd4f88d6a Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 24 Feb 2018 19:18:22 +0900 Subject: Don't copy event content in accessors --- events/event.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'events/event.h') diff --git a/events/event.h b/events/event.h index 968bc1ad..1a1b994d 100644 --- a/events/event.h +++ b/events/event.h @@ -296,10 +296,10 @@ namespace QMatrixClient QJsonObject toJson() const { return _content.toJson(); } - ContentT content() const { return _content; } + const ContentT& content() const { return _content; } /** @deprecated Use prevContent instead */ - ContentT* prev_content() const { return prevContent(); } - ContentT* prevContent() const + const ContentT* prev_content() const { return prevContent(); } + const ContentT* prevContent() const { return _prev ? &_prev->content : nullptr; } QString prevSenderId() const { return _prev ? _prev->senderId : ""; } -- cgit v1.2.3