]> git.saurik.com Git - cydia.git/commitdiff
Cache the epic sort ordering to Cytore.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 1 Dec 2010 01:03:39 +0000 (17:03 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 1 Dec 2010 09:46:27 +0000 (01:46 -0800)
MobileCydia.mm

index 249c15d975f39e4ab94e51c17775463889aefabc..34781f6619781f0a352f882917d3f2aea230d123 100644 (file)
@@ -1926,6 +1926,8 @@ struct ParsedPackage {
 - (NSArray *) purposes;
 - (bool) isCommercial;
 
+- (void) setIndex:(size_t)index;
+
 - (CYString &) cyname;
 
 - (uint32_t) compareBySection:(NSArray *)sections;
@@ -2784,6 +2786,11 @@ struct PackageNameOrdering :
     return [self hasTag:@"cydia::commercial"];
 }
 
+- (void) setIndex:(size_t)index {
+    if (metadata_->index_ != index)
+        metadata_->index_ = index;
+}
+
 - (CYString &) cyname {
     return name_.empty() ? id_ : name_;
 }
@@ -3467,6 +3474,12 @@ static NSString *Warning_;
         //[packages_ sortUsingFunction:reinterpret_cast<NSComparisonResult (*)(id, id, void *)>(&PackageNameCompare) context:NULL];
 
         _trace();
+
+        size_t count(CFArrayGetCount(packages_));
+        for (size_t index(0); index != count; ++index)
+            [(Package *) CFArrayGetValueAtIndex(packages_, index) setIndex:index];
+
+        _trace();
     }
 } } CYPoolEnd() _trace(); }