From 91b00a34b76087d6c7755e3f952d3feeff6c609f Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Fri, 29 Aug 2025 22:22:36 +0200 Subject: [PATCH] Simplify code --- src/libneochat/neochatroom.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libneochat/neochatroom.cpp b/src/libneochat/neochatroom.cpp index d23878b4d..cf53e96ff 100644 --- a/src/libneochat/neochatroom.cpp +++ b/src/libneochat/neochatroom.cpp @@ -1252,10 +1252,8 @@ void NeoChatRoom::reportEvent(const QString &eventId, const QString &reason) QByteArray NeoChatRoom::getEventJsonSource(const QString &eventId) { - auto evtIt = findInTimeline(eventId); - if (evtIt != messageEvents().rend() && is(**evtIt)) { - const auto event = evtIt->viewAs(); - return QJsonDocument(event->fullJson()).toJson(); + if (const auto evtIt = findInTimeline(eventId); evtIt != messageEvents().rend() && is(**evtIt)) { + return QJsonDocument(evtIt->viewAs()->fullJson()).toJson(); } return {}; }