Differences From Artifact [4897ca4a74]:
- File src/OFMutableArray.m — part of check-in [63fc941b66] at 2011-07-20 18:23:41 on branch trunk — Remove code duplication for fast enumeration of mutable collections. (user: js, size: 5589) [annotate] [blame] [check-ins using]
To Artifact [637e903291]:
- File
src/OFMutableArray.m
— part of check-in
[3b0699b790]
at
2011-07-28 22:21:03
on branch trunk
— Don't create and release a pool in -[enumerateObjectsUsingBlock:].
This fixes the mutable versions reimplementing it and still behaving the
old way. (user: js, size: 5380) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
220 221 222 223 224 225 226 | dataArray: array mutationsPointer: &mutations] autorelease]; } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { | < < < < < | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | dataArray: array mutationsPointer: &mutations] autorelease]; } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { id *cArray = [array cArray]; size_t i, count = [array count]; BOOL stop = NO; unsigned long mutations2 = mutations; for (i = 0; i < count && !stop; i++) { if (mutations != mutations2) @throw [OFEnumerationMutationException newWithClass: isa object: self]; block(cArray[i], i, &stop); } } - (void)replaceObjectsUsingBlock: (of_array_replace_block_t)block { id *cArray = [array cArray]; size_t i, count = [array count]; BOOL stop = NO; unsigned long mutations2 = mutations; for (i = 0; i < count && !stop; i++) { id newObject; |
︙ | ︙ | |||
264 265 266 267 268 269 270 | if (newObject == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; [newObject retain]; [cArray[i] release]; cArray[i] = newObject; | | < < < < | 259 260 261 262 263 264 265 266 267 268 269 | if (newObject == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; [newObject retain]; [cArray[i] release]; cArray[i] = newObject; } } #endif @end |