From 787601f22025fc33bbcff768ebc6e554ec2809a2 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 Sep 2020 22:32:50 +0200 Subject: Address clazy warnings --- lib/room.cpp | 2 +- lib/settings.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/room.cpp b/lib/room.cpp index 0a4e041b..6b2b7b23 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -553,7 +553,7 @@ QStringList Room::localAliases() const QStringList Room::remoteAliases() const { QStringList result; - for (const auto& s : d->aliasServers) + for (const auto& s : std::as_const(d->aliasServers)) result += d->getCurrentState(s)->aliases(); return result; } diff --git a/lib/settings.cpp b/lib/settings.cpp index 5413693d..dd086d9c 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -53,11 +53,12 @@ bool Settings::contains(const QString& key) const QStringList Settings::childGroups() const { - auto l = QSettings::childGroups(); - for (const auto& g: legacySettings.childGroups()) - if (!l.contains(g)) - l.push_back(g); - return l; + auto groups = QSettings::childGroups(); + const auto& legacyGroups = legacySettings.childGroups(); + for (const auto& g: legacyGroups) + if (!groups.contains(g)) + groups.push_back(g); + return groups; } void SettingsGroup::setValue(const QString& key, const QVariant& value) -- cgit v1.2.3