From 33918261460041fdda2ee0c80b4a1a754b75842b Mon Sep 17 00:00:00 2001 From: pajlada Date: Mon, 16 Jun 2025 00:20:38 +0200 Subject: [PATCH] fix(clang-tidy): performance-for-range-copy (#6275) --- src/messages/MessageThread.cpp | 4 ++-- src/widgets/settingspages/CommandPage.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/messages/MessageThread.cpp b/src/messages/MessageThread.cpp index c59a3a26..e2a4d03e 100644 --- a/src/messages/MessageThread.cpp +++ b/src/messages/MessageThread.cpp @@ -40,7 +40,7 @@ void MessageThread::addToThread(const std::weak_ptr &message) size_t MessageThread::liveCount() const { size_t count = 0; - for (auto reply : this->replies_) + for (const auto &reply : this->replies_) { if (!reply.expired()) { @@ -55,7 +55,7 @@ size_t MessageThread::liveCount( const std::shared_ptr &exclude) const { size_t count = 0; - for (auto reply : this->replies_) + for (const auto &reply : this->replies_) { if (!reply.expired() && reply.lock() != exclude) { diff --git a/src/widgets/settingspages/CommandPage.cpp b/src/widgets/settingspages/CommandPage.cpp index 833ba713..2ce5ff96 100644 --- a/src/widgets/settingspages/CommandPage.cpp +++ b/src/widgets/settingspages/CommandPage.cpp @@ -110,7 +110,7 @@ CommandPage::CommandPage() QObject::connect(button, &QPushButton::clicked, this, [] { QFile c1settings(c1settingsPath()); c1settings.open(QIODevice::ReadOnly); - for (auto line : + for (const auto &line : QString(c1settings.readAll()) .split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts)) {