From a7b6af21116bb938905697cbb6f060f3dc1278e8 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 20 Oct 2018 21:35:09 +0200 Subject: [PATCH] Small code clean-up. --- src/UpdateChecker.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/UpdateChecker.cpp b/src/UpdateChecker.cpp index b975683..f91b91d 100644 --- a/src/UpdateChecker.cpp +++ b/src/UpdateChecker.cpp @@ -231,23 +231,23 @@ void MUtils::UpdateChecker::checkForUpdates(void) elapsedTimer.start(); do { - if (!mirrorList.isEmpty()) + if (mirrorList.isEmpty()) { - const QString hostName = mirrorList.dequeue(); - if (tryContactHost(hostName, connectionTimout)) + goto endLoop; /*depleted!*/ + } + const QString hostName = mirrorList.dequeue(); + if (tryContactHost(hostName, connectionTimout)) + { + setProgress(1 + (connectionScore += 1)); + if (connectionScore >= MIN_CONNSCORE) { - setProgress(1 + (connectionScore += 1)); - elapsedTimer.restart(); - if (connectionScore >= MIN_CONNSCORE) - { - goto endLoop; /*success*/ - } - } - else - { - mirrorList.enqueue(hostName); /*re-schedule*/ + goto endLoop; /*success*/ } } + else + { + mirrorList.enqueue(hostName); /*re-schedule*/ + } CHECK_CANCELLED(); } while(!elapsedTimer.hasExpired(globalTimout));