Replace Q_UNLIKELY with [[unlikely]] attribute

PR #19445.
This commit is contained in:
Victor Chernyakin 2023-08-10 22:54:26 -07:00 committed by GitHub
parent 502b3d3228
commit 850da9dd83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -3003,7 +3003,7 @@ void SessionImpl::invokeAsync(std::function<void ()> 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();

View file

@ -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();