From 850da9dd8337a25add715a6f84907ae760cdf8fc Mon Sep 17 00:00:00 2001 From: Victor Chernyakin <56512186+LocalSpook@users.noreply.github.com> Date: Thu, 10 Aug 2023 22:54:26 -0700 Subject: [PATCH] Replace Q_UNLIKELY with [[unlikely]] attribute PR #19445. --- src/base/bittorrent/sessionimpl.cpp | 2 +- src/gui/addnewtorrentdialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 74c638c34..6b17cffc7 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -3003,7 +3003,7 @@ void SessionImpl::invokeAsync(std::function func) bool SessionImpl::downloadMetadata(const TorrentDescriptor &torrentDescr) { Q_ASSERT(!torrentDescr.info().has_value()); - if (Q_UNLIKELY(torrentDescr.info().has_value())) + if (torrentDescr.info().has_value()) [[unlikely]] return false; const InfoHash infoHash = torrentDescr.infoHash(); diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index 947a91321..36b1eda3f 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -692,7 +692,7 @@ void AddNewTorrentDialog::contentLayoutChanged() void AddNewTorrentDialog::saveTorrentFile() { Q_ASSERT(hasMetadata()); - if (Q_UNLIKELY(!hasMetadata())) + if (!hasMetadata()) [[unlikely]] return; const auto torrentInfo = *m_torrentDescr.info();