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:
Chocobo1
2025-09-29 03:08:02 +08:00
committed by GitHub
parent 01ac8c012c
commit eed0e56d1a
39 changed files with 86 additions and 85 deletions

View File

@@ -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;
}