mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 00:17:23 -06:00
Use const accessor
This avoids an unnecessary check to the container internal atomic variable and prevents potential detachment. PR #22280.
This commit is contained in:
@@ -199,8 +199,8 @@ QIcon UIThemeManager::getFlagIcon(const QString &countryIsoCode) const
|
||||
return {};
|
||||
|
||||
const QString key = countryIsoCode.toLower();
|
||||
const auto iter = m_flags.find(key);
|
||||
if (iter != m_flags.end())
|
||||
const auto iter = m_flags.constFind(key);
|
||||
if (iter != m_flags.cend())
|
||||
return *iter;
|
||||
|
||||
const QIcon icon {u":/icons/flags/" + key + u".svg"};
|
||||
|
||||
Reference in New Issue
Block a user