From 16fbe93f4cf717cec6e44968ff95b9929b313a9e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 30 Nov 2010 17:03:39 -0800 Subject: [PATCH] Cache the epic sort ordering to Cytore. --- MobileCydia.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MobileCydia.mm b/MobileCydia.mm index 249c15d9..34781f66 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(&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(); } -- 2.45.2