diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-24 19:18:22 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-24 19:42:00 +0900 |
commit | 2c095d29b96393dcfa3121c8cb9f4c4fd4f88d6a (patch) | |
tree | 1904cdb7b484f96fab03c9f9c7d827e97c6aa6f4 /events/event.h | |
parent | b243fc6495e06fa4d41562aa20028dfdb3efd28e (diff) | |
download | libquotient-2c095d29b96393dcfa3121c8cb9f4c4fd4f88d6a.tar.gz libquotient-2c095d29b96393dcfa3121c8cb9f4c4fd4f88d6a.zip |
Don't copy event content in accessors
Diffstat (limited to 'events/event.h')
-rw-r--r-- | events/event.h | 6 |
1 files changed, 3 insertions, 3 deletions
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 : ""; } |