From 75cda86c43d1bec8dc1397ae7b64a5f2494596b3 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Fri, 6 Jun 2025 11:16:33 -0700 Subject: [PATCH] Switch from Object to Set --- src/webui/www/private/scripts/torrent-content.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/webui/www/private/scripts/torrent-content.js b/src/webui/www/private/scripts/torrent-content.js index d33768c81..feef178ba 100644 --- a/src/webui/www/private/scripts/torrent-content.js +++ b/src/webui/www/private/scripts/torrent-content.js @@ -409,19 +409,19 @@ window.qBittorrent.TorrentContent ??= (() => { fileIds.push(Number(torrentFilesTable.getRowFileId(rowId))); }); - const uniqueRowIds = {}; - const uniqueFileIds = {}; + const uniqueRowIds = new Set(); + const uniqueFileIds = new Set(); for (let i = 0; i < rowIds.length; ++i) { const rows = getAllChildren(rowIds[i], fileIds[i]); rows.rowIds.forEach((rowId) => { - uniqueRowIds[rowId] = true; + uniqueRowIds.add(rowId); }); rows.fileIds.forEach((fileId) => { - uniqueFileIds[fileId] = true; + uniqueFileIds.add(fileId); }); } - setFilePriority(Object.keys(uniqueRowIds), Object.keys(uniqueFileIds), priority); + setFilePriority([...uniqueRowIds.keys()], [...uniqueFileIds.keys()], priority); for (const id of rowIds) updateParentFolder(id); };