aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPArrayAdditions.h
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-18 21:34:51 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-18 21:34:51 +0000
commit515e93007d444c33ca82f7c43b76cf8c228cb9d6 (patch)
tree2a65e3bff8c7c50428249c0fcb2b2931c9ab279e /Source/SPArrayAdditions.h
parentc040e154bc58fac262324a0c40ef5572d5ef28c8 (diff)
downloadsequelpro-515e93007d444c33ca82f7c43b76cf8c228cb9d6.tar.gz
sequelpro-515e93007d444c33ca82f7c43b76cf8c228cb9d6.tar.bz2
sequelpro-515e93007d444c33ca82f7c43b76cf8c228cb9d6.zip
• added to SPArrayAdditions.h: NSArrayObjectAtIndex() inline function
- id o = NSArrayObjectAtIndex(anArray, index) :== id o = [anArray objectAtIndex:index] - this speed up it ~3µs per call - replaced that inline function for such calls within loops to speed up them • used IMP function pointers for keepAlive calls within queryString: • set -O3 (Fastest) compiler option • allow in preference pane "Tables" to set the Limit up to 50000
Diffstat (limited to 'Source/SPArrayAdditions.h')
-rw-r--r--Source/SPArrayAdditions.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/SPArrayAdditions.h b/Source/SPArrayAdditions.h
index 7a672dc0..044699db 100644
--- a/Source/SPArrayAdditions.h
+++ b/Source/SPArrayAdditions.h
@@ -24,6 +24,15 @@
#import <Cocoa/Cocoa.h>
+static inline id NSArrayObjectAtIndex(NSArray* self, NSUInteger i) {
+ typedef id (*SPArrayObjectAtIndexMethodPtr)(NSArray*, SEL, NSUInteger);
+ static SPArrayObjectAtIndexMethodPtr SPNSArrayObjectAtIndex;
+ if (!SPNSArrayObjectAtIndex) SPNSArrayObjectAtIndex = (SPArrayObjectAtIndexMethodPtr)[self methodForSelector:@selector(objectAtIndex:)];
+ id to_return = SPNSArrayObjectAtIndex(self, @selector(objectAtIndex:), i);
+ return to_return;
+}
+
+
@interface NSArray (SPArrayAdditions)
- (NSString *)componentsJoinedAndBacktickQuoted;