From 515e93007d444c33ca82f7c43b76cf8c228cb9d6 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 18 Jun 2009 21:34:51 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20to=20SPArrayAdditions.h:=20NSArrayO?= =?UTF-8?q?bjectAtIndex()=20inline=20function=20-=20id=20o=20=3D=20NSArray?= =?UTF-8?q?ObjectAtIndex(anArray,=20index)=20:=3D=3D=20id=20o=20=3D=20[anA?= =?UTF-8?q?rray=20objectAtIndex:index]=20-=20this=20speed=20up=20it=20~3?= =?UTF-8?q?=C2=B5s=20per=20call=20-=20replaced=20that=20inline=20function?= =?UTF-8?q?=20for=20such=20calls=20within=20loops=20to=20speed=20up=20them?= =?UTF-8?q?=20=E2=80=A2=20used=20IMP=20function=20pointers=20for=20keepAli?= =?UTF-8?q?ve=20calls=20within=20queryString:=20=E2=80=A2=20set=20-O3=20(F?= =?UTF-8?q?astest)=20compiler=20option=20=E2=80=A2=20allow=20in=20preferen?= =?UTF-8?q?ce=20pane=20"Tables"=20to=20set=20the=20Limit=20up=20to=2050000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TablesList.m | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Source/TablesList.m') diff --git a/Source/TablesList.m b/Source/TablesList.m index 1cd8d8de..fd794cfc 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -33,6 +33,7 @@ #import "CMMCPConnection.h" #import "CMMCPResult.h" #import "SPStringAdditions.h" +#import "SPArrayAdditions.h" #import "RegexKitLite.h" @implementation TablesList @@ -105,21 +106,21 @@ if( [theResult numOfFields] == 1 ) { for( i = 0; i < [theResult numOfRows]; i++ ) { - [tables addObject:[[theResult fetchRowAsArray] objectAtIndex:3]]; - if( [[[theResult fetchRowAsArray] objectAtIndex:4] isEqualToString:@"PROCEDURE"]) { - [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_PROC]]; + [tables addObject:NSArrayObjectAtIndex([theResult fetchRowAsArray],3)]; + if( [NSArrayObjectAtIndex([theResult fetchRowAsArray], 4) isEqualToString:@"PROCEDURE"]) { + [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_PROC]]; } else { - [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_FUNC]]; + [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_FUNC]]; } } } else { for( i = 0; i < [theResult numOfRows]; i++ ) { resultRow = [theResult fetchRowAsArray]; - [tables addObject:[resultRow objectAtIndex:3]]; - if( [[resultRow objectAtIndex:4] isEqualToString:@"PROCEDURE"] ) { - [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_PROC]]; + [tables addObject:NSArrayObjectAtIndex(resultRow, 3)]; + if( [NSArrayObjectAtIndex(resultRow, 4) isEqualToString:@"PROCEDURE"] ) { + [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_PROC]]; } else { - [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_FUNC]]; + [tableTypes addObject:[NSNumber numberWithInt:SP_TABLETYPE_FUNC]]; } } } -- cgit v1.2.3