summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-11-30 17:03:39 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-12-01 01:46:27 -0800
commitcd95e3901064f7ac343347e5fdc80a173a9426cf (patch)
treec1fd170f9840ed40edbeafc483762f5f861bb252
parent8564efc10bfb681032fc53cf3658b01dfb4ca29f (diff)
Cache the epic sort ordering to Cytore.
-rw-r--r--MobileCydia.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 249c15d..34781f6 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -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(); }