aboutsummaryrefslogtreecommitdiffstats
path: root/Source/NoodleLineNumberView.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/NoodleLineNumberView.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/NoodleLineNumberView.m')
-rw-r--r--Source/NoodleLineNumberView.m7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m
index 2cd2508a..1743782b 100644
--- a/Source/NoodleLineNumberView.m
+++ b/Source/NoodleLineNumberView.m
@@ -31,6 +31,7 @@
// functionality and adds selection by clicking on the ruler.
#import "NoodleLineNumberView.h"
+#import "SPArrayAdditions.h"
#define DEFAULT_THICKNESS 22.0
#define RULER_MARGIN 5.0
@@ -207,7 +208,7 @@
for (line = 0; line < count; line++)
{
- index = [[lines objectAtIndex:line] unsignedIntValue];
+ index = [NSArrayObjectAtIndex(lines, line) unsignedIntValue];
rects = [layoutManager rectArrayForCharacterRange:NSMakeRange(index, 0)
withinSelectedCharacterRange:nullRange
@@ -299,7 +300,7 @@
while ((right - left) > 1)
{
mid = (right + left) / 2;
- lineStart = [[lines objectAtIndex:mid] unsignedIntValue];
+ lineStart = [NSArrayObjectAtIndex(lines, mid) unsignedIntValue];
if (index < lineStart)
{
@@ -405,7 +406,7 @@
for (line = [self lineNumberForCharacterIndex:range.location inText:text]; line < count; line++)
{
- index = [[lines objectAtIndex:line] unsignedIntValue];
+ index = [NSArrayObjectAtIndex(lines, line) unsignedIntValue];
if (NSLocationInRange(index, range))
{