mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07: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:
parent
ddf6dd5fa2
commit
8da43a4054
11 changed files with 45 additions and 45 deletions
|
@ -175,7 +175,7 @@ void DefaultThemeSource::loadColors()
|
|||
const QHash<QString, QColor> lightModeColorOverrides = colorsFromJSON(config.value(KEY_COLORS_LIGHT).toObject());
|
||||
for (auto overridesIt = lightModeColorOverrides.cbegin(); overridesIt != lightModeColorOverrides.cend(); ++overridesIt)
|
||||
{
|
||||
auto it = m_colors.find(overridesIt.key());
|
||||
const auto it = m_colors.find(overridesIt.key());
|
||||
if (it != m_colors.end())
|
||||
it.value().light = overridesIt.value();
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ void DefaultThemeSource::loadColors()
|
|||
const QHash<QString, QColor> darkModeColorOverrides = colorsFromJSON(config.value(KEY_COLORS_DARK).toObject());
|
||||
for (auto overridesIt = darkModeColorOverrides.cbegin(); overridesIt != darkModeColorOverrides.cend(); ++overridesIt)
|
||||
{
|
||||
auto it = m_colors.find(overridesIt.key());
|
||||
const auto it = m_colors.find(overridesIt.key());
|
||||
if (it != m_colors.end())
|
||||
it.value().dark = overridesIt.value();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue