From: Jay Freeman (saurik) Date: Thu, 16 Feb 2017 19:29:49 +0000 (-0800) Subject: Avoid counting a package as "lost" multiple times. X-Git-Tag: v1.1.31~21 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/e65eba85e36a518ccad605c715a88b4ee59ce439 Avoid counting a package as "lost" multiple times. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 64bc7ab9..a16f1940 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -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)