From 4905df000ad745fa65c734ea7aa4cbd53e34b595 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 7 Dec 2010 02:20:00 -0800 Subject: Allow profiling usage of Database::sections_ in -[Database mappedSectionForPointer:]. --- MobileCydia.mm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'MobileCydia.mm') diff --git a/MobileCydia.mm b/MobileCydia.mm index 5f9e1d8..b7050fc 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3685,9 +3685,13 @@ static NSString *Warning_; } - (NSString *) mappedSectionForPointer:(const char *)section { - _H &mapped(sections_[section]); + _H *mapped; - if (mapped == NULL) { + _profile(Database$mappedSectionForPointer$Cache) + mapped = §ions_[section]; + _end + + if (*mapped == NULL) { size_t length(strlen(section)); char spaced[length + 1]; @@ -3704,9 +3708,11 @@ static NSString *Warning_; _end _profile(Database$mappedSectionForPointer$Map) - mapped = [SectionMap_ objectForKey:string] ?: string; + string = [SectionMap_ objectForKey:string] ?: string; _end - } return mapped; + + *mapped = string; + } return *mapped; } @end -- cgit v1.2.3