Fix ratio handling

PR #22638.
This commit is contained in:
Vladimir Golovnev
2025-05-01 14:18:18 +03:00
committed by GitHub
parent e7dee969e1
commit 6cd6267c26
11 changed files with 16 additions and 21 deletions

View File

@@ -1515,7 +1515,8 @@ qreal TorrentImpl::realRatio() const
const qreal ratio = upload / static_cast<qreal>(download);
Q_ASSERT(ratio >= 0);
return (ratio > MAX_RATIO) ? MAX_RATIO : ratio;
return ratio;
}
int TorrentImpl::uploadPayloadRate() const
@@ -2677,8 +2678,6 @@ void TorrentImpl::setRatioLimit(qreal limit)
{
if (limit < USE_GLOBAL_RATIO)
limit = NO_RATIO_LIMIT;
else if (limit > MAX_RATIO)
limit = MAX_RATIO;
if (m_ratioLimit != limit)
{