From f217bbd3c4d700a4b8b1d2f52151b4430f63e2a9 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 2 Feb 2021 21:21:10 +0100 Subject: [PATCH] Don't fetch same modeldata twice --- src/messagefiltermodel.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/messagefiltermodel.cpp b/src/messagefiltermodel.cpp index d9439f779..c911df7fa 100644 --- a/src/messagefiltermodel.cpp +++ b/src/messagefiltermodel.cpp @@ -12,11 +12,9 @@ bool MessageFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sour { const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); - if (index.data(MessageEventModel::SpecialMarksRole).toInt() == EventStatus::Hidden) { - return false; - } + const int specialMarks = index.data(MessageEventModel::SpecialMarksRole).toInt(); - if (index.data(MessageEventModel::SpecialMarksRole).toInt() == EventStatus::Replaced) { + if (specialMarks == EventStatus::Hidden || specialMarks == EventStatus::Replaced) { return false; }