diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index 72e28f5de..f343ccdb2 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -385,7 +385,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle) void NotebookTab::setHighlightState(HighlightState newHighlightStyle, ChannelView &channelViewSource, - MessagePtr message) + const MessagePtr &message) { if (this->isSelected()) { @@ -404,7 +404,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle, return; } - auto splitContainer = + auto *splitContainer = dynamic_cast(this->notebook_->getSelectedPage()); if (splitContainer != nullptr) { @@ -419,14 +419,9 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle, QSet(filterIdsSplit.cbegin(), filterIdsSplit.cend()); auto isSubset = [](QSet sub, QSet super) { - for (auto &&subItem : sub) - { - if (!super.contains(subItem)) - { - return false; - } - } - return true; + return std::ranges::none_of(sub, [&super](const auto &subItem) { + return !super.contains(subItem); + }); }; if (channelViewSource.underlyingChannel() == split->getChannel() && diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index 601957803..1dc0721c9 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -62,7 +62,7 @@ public: void setHighlightState(HighlightState style); void setHighlightState(HighlightState style, ChannelView &channelViewSource, - MessagePtr message); + const MessagePtr &message); HighlightState highlightState() const; void setHighlightsEnabled(const bool &newVal); diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index 6f2893265..e8f654d0a 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -219,7 +219,7 @@ void SplitContainer::addSplit(Split *split) if (this->tab_ != nullptr) { this->tab_->setHighlightState( - state, channelView, message); + state, channelView, std::move(message)); } });