cmd: Replace foreach with range base for (#2219)
authorHarald Eilertsen <haraldei@anduin.net>
Sun, 27 Sep 2020 11:25:52 +0000 (13:25 +0200)
committerHarald Eilertsen <haraldei@anduin.net>
Tue, 29 Sep 2020 17:31:23 +0000 (19:31 +0200)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
src/cmd/cmd.cpp
src/cmd/simplesslerrorhandler.cpp

index cf95be836a9b4d9df7f36581d021858e86673f35..873e9952967e0e69f70b6156d7c5d2b16c4d98a8 100644 (file)
@@ -293,8 +293,8 @@ void selectiveSyncFixup(OCC::SyncJournalDb *journal, const QStringList &newList)
     auto oldBlackListSet = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok).toSet();
     if (ok) {
         auto blackListSet = newList.toSet();
-        auto changes = (oldBlackListSet - blackListSet) + (blackListSet - oldBlackListSet);
-        foreach (const auto &it, changes) {
+        const auto changes = (oldBlackListSet - blackListSet) + (blackListSet - oldBlackListSet);
+        for (const auto &it : changes) {
             journal->avoidReadFromDbOnNextSync(it);
         }
 
index b25e9958fbd079cfdab63f81bcb9e15d6fc39837..48a19977334147a9793eaa209643c933d2ed382a 100644 (file)
@@ -27,7 +27,7 @@ bool SimpleSslErrorHandler::handleErrors(QList<QSslError> errors, const QSslConf
         return false;
     }
 
-    foreach (QSslError error, errors) {
+    for (const auto &error : qAsConst(errors)) {
         certs->append(error.certificate());
     }
     return true;