Skip to content

Commit

Permalink
Replace Q_UNLIKELY with [[unlikely]] attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalSpook authored Aug 11, 2023
1 parent 502b3d3 commit 850da9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/base/bittorrent/sessionimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/addnewtorrentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 850da9d

Please sign in to comment.