Differences From Artifact [9ab2d4adfc]:
- File
src/OFAdjacentArray.m
— part of check-in
[d1a8c88dc6]
at
2023-08-09 08:14:56
on branch trunk
— Add OFSubdata
This replaces the hack of OFAdjacentData being able to keep a pointer to
the parent. (user: js, size: 6310) [annotate] [blame] [check-ins using]
To Artifact [5f63cf2e4a]:
- File src/OFConcreteArray.m — part of check-in [6da6276ae7] at 2023-08-09 08:25:51 on branch trunk — More consistent naming for concrete classes (user: js, size: 6310) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
13 14 15 16 17 18 19 | * file. */ #include "config.h" #include <stdarg.h> | | | | | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | * file. */ #include "config.h" #include <stdarg.h> #import "OFConcreteArray.h" #import "OFConcreteMutableArray.h" #import "OFConcreteSubarray.h" #import "OFData.h" #import "OFString.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFOutOfRangeException.h" @implementation OFConcreteArray - (instancetype)init { self = [super init]; @try { _array = [[OFMutableData alloc] initWithItemSize: sizeof(id)]; } @catch (id e) { |
︙ | ︙ | |||
229 230 231 232 233 234 235 | @throw [OFOutOfRangeException exception]; if ([self isKindOfClass: [OFMutableArray class]]) return [OFArray arrayWithObjects: (id *)_array.items + range.location count: range.length]; | | | | | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | @throw [OFOutOfRangeException exception]; if ([self isKindOfClass: [OFMutableArray class]]) return [OFArray arrayWithObjects: (id *)_array.items + range.location count: range.length]; return [[[OFConcreteSubarray alloc] initWithArray: self range: range] autorelease]; } - (bool)isEqual: (id)object { OFArray *otherArray; id const *objects, *otherObjects; size_t count; if (object == self) return true; if (![object isKindOfClass: [OFConcreteArray class]] && ![object isKindOfClass: [OFConcreteMutableArray class]]) return [super isEqual: object]; otherArray = object; count = _array.count; if (count != otherArray.count) |
︙ | ︙ |