aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
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/CMTextView.m
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/CMTextView.m')
-rw-r--r--Source/CMTextView.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 8e891b20..313a88bc 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -26,6 +26,7 @@
#import "CustomQuery.h"
#import "TableDocument.h"
#import "SPStringAdditions.h"
+#import "SPArrayAdditions.h"
#import "SPTextViewAdditions.h"
#import "SPNarrowDownCompletion.h"
@@ -138,7 +139,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
[queryResult dataSeek:0];
for (i = 0 ; i < [queryResult numOfRows] ; i++)
{
- [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:[[queryResult fetchRowAsArray] objectAtIndex:0], @"display", @"table-small-square", @"image", nil]];
+ [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSArrayObjectAtIndex([queryResult fetchRowAsArray], 0), @"display", @"table-small-square", @"image", nil]];
//[possibleCompletions addObject:[[queryResult fetchRowAsArray] objectAtIndex:0]];
}
@@ -158,7 +159,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
for (i = 0 ; i < [queryResult numOfRows] ; i++)
{
// [possibleCompletions addObject:[[queryResult fetchRowAsArray] objectAtIndex:0]];
- [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:[[queryResult fetchRowAsArray] objectAtIndex:0], @"display", @"database-small", @"image", nil]];
+ [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSArrayObjectAtIndex([queryResult fetchRowAsArray], 0), @"display", @"database-small", @"image", nil]];
}
// Add proc/func only for MySQL version 5 or higher
@@ -170,7 +171,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
for (i = 0 ; i < [queryResult numOfRows] ; i++)
{
// [possibleCompletions addObject:[[queryResult fetchRowAsArray] objectAtIndex:1]];
- [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:[[queryResult fetchRowAsArray] objectAtIndex:1], @"display", @"proc-small", @"image", nil]];
+ [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSArrayObjectAtIndex([queryResult fetchRowAsArray], 1), @"display", @"proc-small", @"image", nil]];
}
// Add all function to completions list for currently selected table
@@ -180,7 +181,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
for (i = 0 ; i < [queryResult numOfRows] ; i++)
{
// [possibleCompletions addObject:[[queryResult fetchRowAsArray] objectAtIndex:1]];
- [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:[[queryResult fetchRowAsArray] objectAtIndex:1], @"display", @"func-small", @"image", nil]];
+ [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:NSArrayObjectAtIndex([queryResult fetchRowAsArray], 1), @"display", @"func-small", @"image", nil]];
}
}
@@ -988,7 +989,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
for (i = 0; i < [matchingCompletions count]; i++)
{
- NSString* obj = [matchingCompletions objectAtIndex:i];
+ NSString* obj = NSArrayObjectAtIndex(matchingCompletions, i);
if(![compl containsObject:obj])
if ([partialString isEqualToString:[obj substringToIndex:partialLength]])
// Matches case --> Insert at beginning of completion list