Small code clean-up.

This commit is contained in:
LoRd_MuldeR 2018-10-20 21:35:09 +02:00
parent 4038c5605b
commit a7b6af2111

View File

@ -231,23 +231,23 @@ void MUtils::UpdateChecker::checkForUpdates(void)
elapsedTimer.start(); elapsedTimer.start();
do do
{ {
if (!mirrorList.isEmpty()) if (mirrorList.isEmpty())
{ {
const QString hostName = mirrorList.dequeue(); goto endLoop; /*depleted!*/
if (tryContactHost(hostName, connectionTimout)) }
const QString hostName = mirrorList.dequeue();
if (tryContactHost(hostName, connectionTimout))
{
setProgress(1 + (connectionScore += 1));
if (connectionScore >= MIN_CONNSCORE)
{ {
setProgress(1 + (connectionScore += 1)); goto endLoop; /*success*/
elapsedTimer.restart();
if (connectionScore >= MIN_CONNSCORE)
{
goto endLoop; /*success*/
}
}
else
{
mirrorList.enqueue(hostName); /*re-schedule*/
} }
} }
else
{
mirrorList.enqueue(hostName); /*re-schedule*/
}
CHECK_CANCELLED(); CHECK_CANCELLED();
} }
while(!elapsedTimer.hasExpired(globalTimout)); while(!elapsedTimer.hasExpired(globalTimout));