Changeset 23377
- Timestamp:
- 05/09/2008 12:34:58 PM (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Frameworks/JSON Framework/Source/NSObject+SBJSON.m
r23362 r23377 29 29 30 30 #import "NSObject+SBJSON.h" 31 32 /* #define ENABLE_FAST_ENUMERATION MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 */ 33 #define ENABLE_FAST_ENUMERATION FALSE 31 34 32 35 typedef struct { … … 168 171 if( x->indent ) [json appendString: open]; 169 172 x->depth++; 170 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 171 unsigned n = [self count]; 172 for (int i = 0; i < n; i++) { 173 id item = [self objectAtIndex:i]; 174 #else 173 #if ENABLE_FAST_ENUMERATION 175 174 int i=-1; 176 175 for( id item in self ) { 177 176 i++; 177 #else 178 unsigned n = [self count]; 179 for (int i = 0; i < n; i++) { 180 id item = [self objectAtIndex:i]; 178 181 #endif 179 182 if( i>0 ) [json appendString: sep]; … … 219 222 x->depth++; 220 223 NSArray *keys = [[self allKeys] sortedArrayUsingSelector:@selector(compare:)]; 221 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 222 unsigned n = [keys count]; 224 #if ENABLE_FAST_ENUMERATION 225 int i=-1; 226 for( NSString *key in keys ) { 227 i++; 228 #else 229 unsigned n = [keys count]; 223 230 for (int i = 0; i < n; i++) { 224 231 NSString *key = [keys objectAtIndex:i]; 225 #else226 int i=-1;227 for( NSString *key in keys ) {228 i++;229 232 #endif 230 233 if( i>0 ) [json appendString: sep];