From 7bc0d82556d4169b4b2221a0373ca2262abebcc8 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 2 Jul 2015 03:24:01 -0700 Subject: Avoid duplication of pkgSourceList.ReadMainList(). --- MobileCydia.mm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'MobileCydia.mm') diff --git a/MobileCydia.mm b/MobileCydia.mm index d67a01e..0ae9485 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3770,6 +3770,12 @@ class CydiaLogCleaner : return [self popErrorWithTitle:title] || !success; } +- (bool) popErrorWithTitle:(NSString *)title forReadList:(pkgSourceList &)list { + if ([self popErrorWithTitle:title forOperation:list.ReadMainList()]) + return true; + return false; +} + - (void) reloadDataWithInvocation:(NSInvocation *)invocation { @synchronized (self) { ++era_; @@ -3814,7 +3820,7 @@ class CydiaLogCleaner : list_ = new pkgSourceList(); _profile(reloadDataWithInvocation$ReadMainList) - if ([self popErrorWithTitle:title forOperation:list_->ReadMainList()]) + if ([self popErrorWithTitle:title forReadList:*list_]) return; _end @@ -4032,7 +4038,7 @@ class CydiaLogCleaner : return false; pkgSourceList list; - if ([self popErrorWithTitle:title forOperation:list.ReadMainList()]) + if ([self popErrorWithTitle:title forReadList:list]) return false; manager_ = (_system->CreatePM(cache_)); @@ -4050,7 +4056,7 @@ class CydiaLogCleaner : NSMutableArray *before = [NSMutableArray arrayWithCapacity:16]; { pkgSourceList list; - if ([self popErrorWithTitle:title forOperation:list.ReadMainList()]) + if ([self popErrorWithTitle:title forReadList:list]) return; for (pkgSourceList::const_iterator source = list.begin(); source != list.end(); ++source) [before addObject:[NSString stringWithUTF8String:(*source)->GetURI().c_str()]]; @@ -4108,7 +4114,7 @@ class CydiaLogCleaner : NSMutableArray *after = [NSMutableArray arrayWithCapacity:16]; { pkgSourceList list; - if ([self popErrorWithTitle:title forOperation:list.ReadMainList()]) + if ([self popErrorWithTitle:title forReadList:list]) return; for (pkgSourceList::const_iterator source = list.begin(); source != list.end(); ++source) [after addObject:[NSString stringWithUTF8String:(*source)->GetURI().c_str()]]; @@ -4133,7 +4139,7 @@ class CydiaLogCleaner : NSString *title(UCLocalize("REFRESHING_DATA")); pkgSourceList list; - if ([self popErrorWithTitle:title forOperation:list.ReadMainList()]) + if ([self popErrorWithTitle:title forReadList:list]) return; FileFd lock; -- cgit v1.2.3