]> git.saurik.com Git - cydia.git/commitdiff
Allow profiling usage of Database::sections_ in -[Database mappedSectionForPointer:].
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 7 Dec 2010 10:20:00 +0000 (02:20 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 1 Jan 2011 22:32:06 +0000 (14:32 -0800)
MobileCydia.mm

index 5f9e1d8228a50b938e487311042203ea0d155c42..b7050fc6d3dafbded0ce1e5468f64f2a1b8bd902 100644 (file)
@@ -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