From 0e1849346bf184bd8be480352eb5768085f976e7 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 28 Nov 2021 20:34:14 +0800 Subject: [PATCH] Avoid iterating over a temporary variable --- src/gui/categoryfiltermodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/categoryfiltermodel.cpp b/src/gui/categoryfiltermodel.cpp index 7a910d463..8e288a449 100644 --- a/src/gui/categoryfiltermodel.cpp +++ b/src/gui/categoryfiltermodel.cpp @@ -412,7 +412,8 @@ void CategoryFilterModel::populate() , [](Torrent *torrent) { return torrent->category().isEmpty(); }))); using Torrent = BitTorrent::Torrent; - for (auto i = session->categories().cbegin(); i != session->categories().cend(); ++i) + const QStringMap categories = session->categories(); + for (auto i = categories.cbegin(); i != categories.cend(); ++i) { const QString &category = i.key(); if (m_isSubcategoriesEnabled)