mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07:00
Check cheaper conditional first
This commit is contained in:
parent
95b452a3e9
commit
9d25405144
1 changed files with 5 additions and 5 deletions
|
@ -239,19 +239,19 @@ QString TransferListModel::displayValue(const BitTorrent::TorrentHandle *torrent
|
|||
|
||||
const auto availabilityString = [hideValues](const qreal value) -> QString
|
||||
{
|
||||
return ((value <= 0) && hideValues)
|
||||
return (hideValues && (value <= 0))
|
||||
? QString {} : Utils::String::fromDouble(value, 3);
|
||||
};
|
||||
|
||||
const auto unitString = [hideValues](const qint64 value, const bool isSpeedUnit = false) -> QString
|
||||
{
|
||||
return ((value == 0) && hideValues)
|
||||
return (hideValues && (value == 0))
|
||||
? QString {} : Utils::Misc::friendlyUnit(value, isSpeedUnit);
|
||||
};
|
||||
|
||||
const auto limitString = [hideValues](const qint64 value) -> QString
|
||||
{
|
||||
if ((value == 0) && hideValues)
|
||||
if (hideValues && (value == 0))
|
||||
return {};
|
||||
|
||||
return (value > 0)
|
||||
|
@ -261,14 +261,14 @@ QString TransferListModel::displayValue(const BitTorrent::TorrentHandle *torrent
|
|||
|
||||
const auto amountString = [hideValues](const qint64 value, const qint64 total) -> QString
|
||||
{
|
||||
return ((value == 0) && (total == 0) && hideValues)
|
||||
return (hideValues && (value == 0) && (total == 0))
|
||||
? QString {}
|
||||
: QString::number(value) + " (" + QString::number(total) + ')';
|
||||
};
|
||||
|
||||
const auto ratioString = [hideValues](const qreal value) -> QString
|
||||
{
|
||||
if ((value <= 0) && hideValues)
|
||||
if (hideValues && (value <= 0))
|
||||
return {};
|
||||
|
||||
return ((static_cast<int>(value) == -1) || (value > BitTorrent::TorrentHandle::MAX_RATIO))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue