mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-04 08:37:35 +00:00
WebUI: Improve lookup performance when filtering by tracker
Torrent hashes in tracker list are now kept in sets instead of arrays. PR #21405.
This commit is contained in:
parent
449ca96e28
commit
d8e24314ec
@ -805,8 +805,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
trackerListItem = { host: host, trackerTorrentMap: new Map() };
|
trackerListItem = { host: host, trackerTorrentMap: new Map() };
|
||||||
trackerList.set(hash, trackerListItem);
|
trackerList.set(hash, trackerListItem);
|
||||||
}
|
}
|
||||||
|
trackerListItem.trackerTorrentMap.set(tracker, new Set(torrents));
|
||||||
trackerListItem.trackerTorrentMap.set(tracker, [...torrents]);
|
|
||||||
}
|
}
|
||||||
updateTrackers = true;
|
updateTrackers = true;
|
||||||
}
|
}
|
||||||
|
@ -1485,7 +1485,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||||||
if (tracker) {
|
if (tracker) {
|
||||||
let found = false;
|
let found = false;
|
||||||
for (const torrents of tracker.trackerTorrentMap.values()) {
|
for (const torrents of tracker.trackerTorrentMap.values()) {
|
||||||
if (torrents.includes(row["full_data"].rowId)) {
|
if (torrents.has(row["full_data"].rowId)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user