From 9d87348260316af729892c58bc29f159a173abf1 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 23 Feb 2021 00:37:11 +0200 Subject: Minor code optimisation - Use more range-for loops where appropriate - Use auto instead of the usually-long iterator type names - Use cbegin/cend(), to match the std:: containers, less confusion - Use qDeleteAll instead of a for loop - Make a QRE with a long-ish pattern static NO_CHANGELOG --- src/core/kauthorized.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/kauthorized.cpp') diff --git a/src/core/kauthorized.cpp b/src/core/kauthorized.cpp index 46b33ab2..a8784a1c 100644 --- a/src/core/kauthorized.cpp +++ b/src/core/kauthorized.cpp @@ -251,9 +251,9 @@ QStringList KAuthorized::authorizeControlModules(const QStringList &menuIds) { KConfigGroup cg(KSharedConfig::openConfig(), "KDE Control Module Restrictions"); QStringList result; - for (QStringList::ConstIterator it = menuIds.begin(); it != menuIds.end(); ++it) { - if (cg.readEntry(*it, true)) { - result.append(*it); + for (const auto &id : menuIds) { + if (cg.readEntry(id, true)) { + result.append(id); } } return result; -- cgit v1.2.1