Differences From Artifact [7c4a615aae]:
- File
src/OFArray_adjacent.m
— part of check-in
[d5ddb2cb48]
at
2012-06-06 13:09:08
on branch trunk
— Rework OFDataArray API.
Also adds more checks. (user: js, size: 6253) [annotate] [blame] [check-ins using] [more...]
To Artifact [a6c8e71afe]:
- File src/OFArray_adjacent.m — part of check-in [8892ae9fcc] at 2012-07-12 01:28:46 on branch trunk — Don't access isa directly. (user: js, size: 6280) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
158 159 160 161 162 163 164 | pool = [[OFAutoreleasePool alloc] init]; if ((![[element name] isEqual: @"OFArray"] && ![[element name] isEqual: @"OFMutableArray"]) || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException | | | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | pool = [[OFAutoreleasePool alloc] init]; if ((![[element name] isEqual: @"OFArray"] && ![[element name] isEqual: @"OFMutableArray"]) || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; enumerator = [[element elementsForNamespace: OF_SERIALIZATION_NS] objectEnumerator]; pool2 = [[OFAutoreleasePool alloc] init]; while ((child = [enumerator nextObject]) != nil) { |
︙ | ︙ | |||
209 210 211 212 213 214 215 | - (void)getObjects: (id*)buffer inRange: (of_range_t)range { id *objects = [array cArray]; size_t i, count = [array count]; if (range.start + range.length > count) | | | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - (void)getObjects: (id*)buffer inRange: (of_range_t)range { id *objects = [array cArray]; size_t i, count = [array count]; if (range.start + range.length > count) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; for (i = 0; i < range.length; i++) buffer[i] = objects[range.start + i]; } - (size_t)indexOfObject: (id)object { |
︙ | ︙ | |||
251 252 253 254 255 256 257 | if (![self isKindOfClass: [OFMutableArray class]]) return [OFArray_adjacentSubarray arrayWithArray: self range: range]; count = [array count]; if (range.start + range.length > count) | | | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | if (![self isKindOfClass: [OFMutableArray class]]) return [OFArray_adjacentSubarray arrayWithArray: self range: range]; count = [array count]; if (range.start + range.length > count) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; return [OFArray arrayWithObjects: (id*)[array cArray] + range.start count: range.length]; } - (BOOL)isEqual: (id)object { |
︙ | ︙ |