mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Use proper return type
`count()`, `length()`, `size()`, `indexOf()` and `lastIndexOf()` were returning `int` in Qt5. In Qt6 they return `qsizetype`. PR #23317.
This commit is contained in:
@@ -273,12 +273,12 @@ QString PeerInfo::connectionType() const
|
||||
|
||||
qreal PeerInfo::calcRelevance(const QBitArray &allPieces) const
|
||||
{
|
||||
const int localMissing = allPieces.count(false);
|
||||
const qsizetype localMissing = allPieces.count(false);
|
||||
if (localMissing <= 0)
|
||||
return 0;
|
||||
|
||||
const QBitArray peerPieces = pieces();
|
||||
const int remoteHaves = (peerPieces & (~allPieces)).count(true);
|
||||
const qsizetype remoteHaves = (peerPieces & (~allPieces)).count(true);
|
||||
return static_cast<qreal>(remoteHaves) / localMissing;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user