Differences From Artifact [2158b59870]:
- File
src/OFArray_adjacent.m
— part of check-in
[2de15db195]
at
2013-03-01 21:19:02
on branch trunk
— Rethrow some exceptions to fix class.
This way, the error message will show the called class instead of the
class used internally. (user: js, size: 6970) [annotate] [blame] [check-ins using]
To Artifact [712ba693de]:
- File
src/OFArray_adjacent.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 6984) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
134 135 136 137 138 139 140 | - initWithObjects: (id const*)objects count: (size_t)count { self = [self init]; @try { size_t i; | | | | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - initWithObjects: (id const*)objects count: (size_t)count { self = [self init]; @try { size_t i; bool ok = true; for (i = 0; i < count; i++) { if (objects[i] == nil) ok = false; [objects[i] retain]; } if (!ok) @throw [OFInvalidArgumentException exceptionWithClass: [self class]]; |
︙ | ︙ | |||
296 297 298 299 300 301 302 | arrayWithObjects: (id*)[_array items] + range.location count: range.length]; return [OFArray_adjacentSubarray arrayWithArray: self range: range]; } | | | | | | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | arrayWithObjects: (id*)[_array items] + range.location count: range.length]; return [OFArray_adjacentSubarray arrayWithArray: self range: range]; } - (bool)isEqual: (id)object { OFArray *otherArray; id *objects, *otherObjects; size_t i, count; if ([object class] != [OFArray_adjacent class] && [object class] != [OFMutableArray_adjacent class] && [object class] != [OFArray_adjacentSubarray class]) return [super isEqual: object]; otherArray = object; count = [_array count]; if (count != [otherArray count]) return false; objects = [_array items]; otherObjects = [otherArray objects]; for (i = 0; i < count; i++) if (![objects[i] isEqual: otherObjects[i]]) return false; return true; } - (uint32_t)hash { id *objects = [_array items]; size_t i, count = [_array count]; uint32_t hash; |
︙ | ︙ | |||
345 346 347 348 349 350 351 | } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { id *objects = [_array items]; size_t i, count = [_array count]; | | | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { id *objects = [_array items]; size_t i, count = [_array count]; bool stop = false; for (i = 0; i < count && !stop; i++) block(objects[i], i, &stop); } #endif - (void)dealloc |
︙ | ︙ |