@@ -559,12 +559,10 @@ - (OFString*)OF_JSONRepresentationWithOptions: (int)options depth: (size_t)depth { OFMutableString *JSON = [OFMutableString stringWithString: @"["]; void *pool = objc_autoreleasePoolPush(); - OFEnumerator *enumerator = [self objectEnumerator]; - id object; size_t i, count = [self count]; if (options & OF_JSON_REPRESENTATION_PRETTY) { OFMutableString *indentation = [OFMutableString string]; @@ -572,11 +570,11 @@ [indentation appendString: @"\t"]; [JSON appendString: @"\n"]; i = 0; - while ((object = [enumerator nextObject]) != nil) { + for (id object in self) { void *pool2 = objc_autoreleasePoolPush(); [JSON appendString: indentation]; [JSON appendString: @"\t"]; [JSON appendString: [object @@ -592,11 +590,11 @@ } [JSON appendString: indentation]; } else { i = 0; - while ((object = [enumerator nextObject]) != nil) { + for (id object in self) { void *pool2 = objc_autoreleasePoolPush(); [JSON appendString: [object OF_JSONRepresentationWithOptions: options depth: depth + 1]]; @@ -619,12 +617,10 @@ - (OFDataArray*)messagePackRepresentation { OFDataArray *data; size_t i, count; void *pool; - OFEnumerator *enumerator; - id object; data = [OFDataArray dataArray]; count = [self count]; if (count <= 15) { @@ -648,12 +644,11 @@ @throw [OFOutOfRangeException exception]; pool = objc_autoreleasePoolPush(); i = 0; - enumerator = [self objectEnumerator]; - while ((object = [enumerator nextObject]) != nil) { + for (id object in self) { void *pool2 = objc_autoreleasePoolPush(); OFDataArray *child; i++; @@ -753,11 +748,11 @@ { return [[[OFArrayEnumerator alloc] initWithArray: self mutationsPtr: NULL] autorelease]; } -#if defined(OF_HAVE_BLOCKS) && defined(OF_HAVE_FAST_ENUMERATION) +#ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { size_t i = 0; bool stop = false;