mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 22:14:32 +00:00
Merge pull request #6814 from Chocobo1/defects
[QuickFix] Fix coverity issues
This commit is contained in:
commit
494601ea75
@ -2053,8 +2053,10 @@ void TorrentHandle::prioritizeFiles(const QVector<int> &priorities)
|
|||||||
|
|
||||||
QVector<qreal> TorrentHandle::availableFileFractions() const
|
QVector<qreal> TorrentHandle::availableFileFractions() const
|
||||||
{
|
{
|
||||||
QVector<int> piecesAvailability = pieceAvailability();
|
|
||||||
const auto filesCount = this->filesCount();
|
const auto filesCount = this->filesCount();
|
||||||
|
if (filesCount < 0) return {};
|
||||||
|
|
||||||
|
const QVector<int> piecesAvailability = pieceAvailability();
|
||||||
// libtorrent returns empty array for seeding only torrents
|
// libtorrent returns empty array for seeding only torrents
|
||||||
if (piecesAvailability.empty()) return QVector<qreal>(filesCount, -1.);
|
if (piecesAvailability.empty()) return QVector<qreal>(filesCount, -1.);
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ namespace Utils
|
|||||||
throw std::runtime_error ("Incorrect number of version components");
|
throw std::runtime_error ("Incorrect number of version components");
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
ComponentsArray res;
|
ComponentsArray res{};
|
||||||
for (std::size_t i = 0; i < static_cast<std::size_t>(versionParts.size()); ++i) {
|
for (std::size_t i = 0; i < static_cast<std::size_t>(versionParts.size()); ++i) {
|
||||||
res[i] = static_cast<T>(versionParts[i].toInt(&ok));
|
res[i] = static_cast<T>(versionParts[i].toInt(&ok));
|
||||||
if (!ok)
|
if (!ok)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user