summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-12-07 02:20:00 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-01-01 14:32:06 -0800
commit4905df000ad745fa65c734ea7aa4cbd53e34b595 (patch)
treefee0a99ad4a6668154a4e50dc1fb073b732f52b2
parentcf48f65699b65f3aefb5b76bb36a9dbc76fdd6f6 (diff)
Allow profiling usage of Database::sections_ in -[Database mappedSectionForPointer:].
-rw-r--r--MobileCydia.mm14
1 files changed, 10 insertions, 4 deletions
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<NSString> &mapped(sections_[section]);
+ _H<NSString> *mapped;
- if (mapped == NULL) {
+ _profile(Database$mappedSectionForPointer$Cache)
+ mapped = &sections_[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