Skip to content

Commit 7a77673

Browse files
committed
Switch from Object to Set
1 parent 761546c commit 7a77673

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/webui/www/private/scripts/torrent-content.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,19 +409,19 @@ window.qBittorrent.TorrentContent ??= (() => {
409409
fileIds.push(Number(torrentFilesTable.getRowFileId(rowId)));
410410
});
411411

412-
const uniqueRowIds = {};
413-
const uniqueFileIds = {};
412+
const uniqueRowIds = new Set();
413+
const uniqueFileIds = new Set();
414414
for (let i = 0; i < rowIds.length; ++i) {
415415
const rows = getAllChildren(rowIds[i], fileIds[i]);
416416
rows.rowIds.forEach((rowId) => {
417-
uniqueRowIds[rowId] = true;
417+
uniqueRowIds.add(rowId);
418418
});
419419
rows.fileIds.forEach((fileId) => {
420-
uniqueFileIds[fileId] = true;
420+
uniqueFileIds.add(fileId);
421421
});
422422
}
423423

424-
setFilePriority(Object.keys(uniqueRowIds), Object.keys(uniqueFileIds), priority);
424+
setFilePriority([...uniqueRowIds.keys()], [...uniqueFileIds.keys()], priority);
425425
for (const id of rowIds)
426426
updateParentFolder(id);
427427
};

0 commit comments

Comments
 (0)