]> git.saurik.com Git - cydia.git/commitdiff
Avoid counting a package as "lost" multiple times.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 16 Feb 2017 19:29:49 +0000 (11:29 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 16 Feb 2017 19:29:49 +0000 (11:29 -0800)
MobileCydia.mm

index 64bc7ab92ad699245c43004f32996ba155ef4500..a16f1940e8d79f18dd4dc669b8826a45bcdd7c67 100644 (file)
@@ -3909,20 +3909,21 @@ class CydiaLogCleaner :
                         continue;
                     } else {
                         std::swap(package, packages[index]);
-                        if (package != nil)
+                        if (package != nil) {
+                            if (package.metadata->index_ == index + 1)
+                                ++lost;
                             goto lost;
+                        }
                         if (last != index)
                             continue;
                     }
-                } else lost: {
+                } else {
                     ++lost;
-                    if (last == packages.size()) {
+                    lost: if (last == packages.size())
                         packages.push_back(package);
-                        ++last;
-                    } else {
+                    else
                         packages[last] = package;
-                        ++last;
-                    }
+                    ++last;
                 }
 
                 for (; last != packages.size(); ++last)