From b63f57435ccd5337f4b054011197887c374ae9f2 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:37:50 +0000 Subject: [PATCH] fix: setTags compilation err --- src/webui/api/torrentscontroller.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 23145f87fe1..2d4136943db 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -1482,15 +1482,16 @@ void TorrentsController::setTagsAction() const QStringList hashes {params()[u"hashes"_s].split(u'|', Qt::SkipEmptyParts)}; const QStringList tags {params()[u"tags"_s].split(u',', Qt::SkipEmptyParts)}; - TagSet newTags {tags.begin(), tags.end()}; - applyToTorrents(hashes, [newTags](BitTorrent::Torrent *const torrent) + const TagSet newTags {tags.begin(), tags.end()}; + applyToTorrents(hashes, [&newTags](BitTorrent::Torrent *const torrent) { + TagSet tmpTags {newTags}; for (const Tag &tag : asConst(torrent->tags())) { - if (newTags.erase(tag) == 0) + if (tmpTags.erase(tag) == 0) torrent->removeTag(tag); } - for (const Tag &tag : newTags) + for (const Tag &tag : tmpTags) torrent->addTag(tag); }); }