Differences From Artifact [e067dd075f]:
- File src/OFArray_adjacentSubarray.m — part of check-in [3b97fc3cd9] at 2014-01-04 00:24:08 on branch trunk — Update copyright. (user: js, size: 1604) [annotate] [blame] [check-ins using]
To Artifact [e44a0576ae]:
- File
src/OFArray_adjacentSubarray.m
— part of check-in
[68d32a92c1]
at
2014-06-16 15:06:26
on branch trunk
— Make return type of -[OFArray objects] const
After all, this might (and does for OFArray_adjacent!) return an
internal representation that must not be changed, so changes should be
prevented at compile-time. (user: js, size: 1622) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
17 18 19 20 21 22 23 | #include "config.h" #import "OFArray_adjacentSubarray.h" #import "OFArray_adjacent.h" #import "OFMutableArray_adjacent.h" @implementation OFArray_adjacentSubarray | | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #include "config.h" #import "OFArray_adjacentSubarray.h" #import "OFArray_adjacent.h" #import "OFMutableArray_adjacent.h" @implementation OFArray_adjacentSubarray - (const id*)objects { return [_array objects] + _range.location; } - (bool)isEqual: (id)object { OFArray *otherArray; id const *objects, *otherObjects; size_t i; if ([object class] != [OFArray_adjacent class] && [object class] != [OFMutableArray_adjacent class] && [object class] != [OFArray_adjacentSubarray class]) return [super isEqual: object]; |
︙ | ︙ | |||
51 52 53 54 55 56 57 | return true; } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { | | | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | return true; } #ifdef OF_HAVE_BLOCKS - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block { id const *objects = [self objects]; size_t i; bool stop = false; for (i = 0; i < _range.length && !stop; i++) block(objects[i], i, &stop); } #endif @end |