OSDN Git Service

Small code clean-up.
authorLoRd_MuldeR <mulder2@gmx.de>
Sat, 20 Oct 2018 19:35:09 +0000 (21:35 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Sat, 20 Oct 2018 19:35:09 +0000 (21:35 +0200)
src/UpdateChecker.cpp

index b975683..f91b91d 100644 (file)
@@ -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))
-                               {
-                                       setProgress(1 + (connectionScore += 1));
-                                       elapsedTimer.restart();
-                                       if (connectionScore >= MIN_CONNSCORE)
-                                       {
-                                               goto endLoop; /*success*/
-                                       }
-                               }
-                               else
+                               goto endLoop; /*depleted!*/
+                       }
+                       const QString hostName = mirrorList.dequeue();
+                       if (tryContactHost(hostName, connectionTimout))
+                       {
+                               setProgress(1 + (connectionScore += 1));
+                               if (connectionScore >= MIN_CONNSCORE)
                                {
-                                       mirrorList.enqueue(hostName); /*re-schedule*/
+                                       goto endLoop; /*success*/
                                }
                        }
+                       else
+                       {
+                               mirrorList.enqueue(hostName); /*re-schedule*/
+                       }
                        CHECK_CANCELLED();
                }
                while(!elapsedTimer.hasExpired(globalTimout));