From 778d7280bae1fe413e0b2db799495454ac165c35 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 13 Jul 2009 21:05:51 +0000 Subject: Rework data storage and retrieval in TableContent and CustomQuery backing arrays, and make some editable CustomQuery improvements: - Switch to using arrays for row storage rather than dictionaries. Use the data column index for table column identifiers. - This fixes Issue #316 and also allows sorting by all custom query result columns using a column index rather than the name - Offers significant speed and memory advantages: result building is now 2x-3x faster, memory used for results storage is 30-40% lower, and result access is slightly faster. (Note full 2x-3x speed results won't be seen - result fetching and mysql binary work isn't included in the timing) - No longer need to fetch the first column of data for tables containing only blob types - Correctly escape strings when editing CustomQuery results - Rewrite NSArrayObjectAtIndex to use the native CFArrayGetValueAtIndex rather than cached selectors - neater code and I think slightly faster --- Source/SPArrayAdditions.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Source/SPArrayAdditions.h') diff --git a/Source/SPArrayAdditions.h b/Source/SPArrayAdditions.h index 044699db..2d59d055 100644 --- a/Source/SPArrayAdditions.h +++ b/Source/SPArrayAdditions.h @@ -25,11 +25,7 @@ #import 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; + return (id)CFArrayGetValueAtIndex((CFArrayRef)self, i); } -- cgit v1.2.3