From: Jay Freeman (saurik) Date: Tue, 7 Dec 2010 10:20:00 +0000 (-0800) Subject: Allow profiling usage of Database::sections_ in -[Database mappedSectionForPointer:]. X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/1b9ba5964135b35d5fc2357d05e1754f0b97d479 Allow profiling usage of Database::sections_ in -[Database mappedSectionForPointer:]. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 5f9e1d82..b7050fc6 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