diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2021-02-23 00:37:11 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2021-03-06 01:35:08 +0200 |
commit | 9d87348260316af729892c58bc29f159a173abf1 (patch) | |
tree | af81edda4bf441239f4ccc66dbfb533c5be26a47 /src/core/kauthorized.cpp | |
parent | ee35bdce8f6b08922b4c9e0c0c838e5f2c4a79ad (diff) | |
download | kconfig-9d87348260316af729892c58bc29f159a173abf1.tar.gz kconfig-9d87348260316af729892c58bc29f159a173abf1.tar.bz2 |
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
Diffstat (limited to 'src/core/kauthorized.cpp')
-rw-r--r-- | src/core/kauthorized.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; |