aboutsummaryrefslogtreecommitdiffstats
path: root/core/checkcloudconnection.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-19 11:37:46 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-19 12:51:01 -0700
commit194fe28d5053027cb6f3818f836ffb0f57667ef7 (patch)
tree2313516cfceb7322f5cbb50e7214869736e69260 /core/checkcloudconnection.cpp
parent9620d1182885bb8ac0dd05eeaf8d4e108461cfab (diff)
downloadsubsurface-194fe28d5053027cb6f3818f836ffb0f57667ef7.tar.gz
cleanup: don't hardcode array length
Move the ARRAY_SIZE macro into a header file and use it to determine the number of cloud servers that we need to check. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/checkcloudconnection.cpp')
-rw-r--r--core/checkcloudconnection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/checkcloudconnection.cpp b/core/checkcloudconnection.cpp
index b8e9fc26f..7b86eaaa7 100644
--- a/core/checkcloudconnection.cpp
+++ b/core/checkcloudconnection.cpp
@@ -106,7 +106,7 @@ bool CheckCloudConnection::nextServer()
{ CLOUD_HOST_US, false }
};
const char *server = nullptr;
- for (int i = 0; i < CLOUD_NUM_HOSTS; i++) {
+ 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)