From 59d678b5b13baabdffad39ede689d6cb5a83d163 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 12 Nov 2022 09:06:01 +0100 Subject: [PATCH] cleanup: use range based for instead of loop with index Signed-off-by: Berthold Stoeger --- core/checkcloudconnection.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/checkcloudconnection.cpp b/core/checkcloudconnection.cpp index 080f4bc8e..788abe50e 100644 --- a/core/checkcloudconnection.cpp +++ b/core/checkcloudconnection.cpp @@ -106,11 +106,11 @@ bool CheckCloudConnection::nextServer() { CLOUD_HOST_US, false } }; const char *server = nullptr; - for (unsigned int i = 0; i < ARRAY_SIZE(cloudServers); i++) { - if (strstr(prefs.cloud_base_url, cloudServers[i].server)) - cloudServers[i].tried = true; - else if (cloudServers[i].tried == false) - server = cloudServers[i].server; + for (serverTried &item: cloudServers) { + if (strstr(prefs.cloud_base_url, item.server)) + item.tried = true; + else if (item.tried == false) + server = item.server; } if (server) { int s = strlen(server);