mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 06:13:36 -07:00
Merge pull request #2958 from Chocobo1/neg_loop
Fix potential negative loop bound
This commit is contained in:
commit
174861274b
2 changed files with 4 additions and 4 deletions
|
@ -732,8 +732,8 @@ void QTorrentHandle::prioritize_first_last_piece(bool b) const
|
||||||
{
|
{
|
||||||
if (!has_metadata()) return;
|
if (!has_metadata()) return;
|
||||||
// Download first and last pieces first for all media files in the torrent
|
// Download first and last pieces first for all media files in the torrent
|
||||||
const uint nbfiles = num_files();
|
const int nbfiles = num_files();
|
||||||
for (uint index = 0; index < nbfiles; ++index) {
|
for (int index = 0; index < nbfiles; ++index) {
|
||||||
const QString path = filepath_at(index);
|
const QString path = filepath_at(index);
|
||||||
const QString ext = fsutils::fileExtension(path);
|
const QString ext = fsutils::fileExtension(path);
|
||||||
if (misc::isPreviewable(ext) && torrent_handle::file_priority(index) > 0) {
|
if (misc::isPreviewable(ext) && torrent_handle::file_priority(index) > 0) {
|
||||||
|
|
|
@ -60,8 +60,8 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
|
||||||
// Fill list in
|
// Fill list in
|
||||||
std::vector<libtorrent::size_type> fp;
|
std::vector<libtorrent::size_type> fp;
|
||||||
h.file_progress(fp);
|
h.file_progress(fp);
|
||||||
unsigned int nbFiles = h.num_files();
|
int nbFiles = h.num_files();
|
||||||
for (unsigned int i=0; i<nbFiles; ++i) {
|
for (int i=0; i<nbFiles; ++i) {
|
||||||
QString fileName = h.filename_at(i);
|
QString fileName = h.filename_at(i);
|
||||||
if (fileName.endsWith(".!qB"))
|
if (fileName.endsWith(".!qB"))
|
||||||
fileName.chop(4);
|
fileName.chop(4);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue