mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Merge pull request #8558 from luis-pereira/containter-anti-pattern
Don't create temporary containers just to iterate over them
This commit is contained in:
@@ -186,9 +186,10 @@ bool upgrade(bool ask = true)
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const QString &hash, oldResumeData.keys()) {
|
||||
QVariantHash oldTorrent = oldResumeData[hash].toHash();
|
||||
for (auto i = oldResumeData.cbegin(); i != oldResumeData.cend(); ++i) {
|
||||
const QVariantHash oldTorrent = i.value().toHash();
|
||||
if (oldTorrent.value("is_magnet", false).toBool()) {
|
||||
const QString &hash = i.key();
|
||||
libtorrent::entry resumeData;
|
||||
resumeData["qBt-magnetUri"] = oldTorrent.value("magnet_uri").toString().toStdString();
|
||||
resumeData["qBt-paused"] = false;
|
||||
|
||||
Reference in New Issue
Block a user