235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
+
-
-
-
-
+
+
+
+
+
+
|
buffer[i] = [self objectAtIndex: range.location + i];
}
- (id const *)objects
{
size_t count = self.count;
id *buffer = OFAllocMemory(count, sizeof(id));
id const *ret;
@try {
[self getObjects: buffer inRange: OFRangeMake(0, count)];
return [[OFData dataWithItemsNoCopy: buffer
count: count
itemSize: sizeof(id)
freeWhenDone: true] items];
ret = [[OFData dataWithItemsNoCopy: buffer
count: count
itemSize: sizeof(id)
freeWhenDone: true] items];
} @catch (id e) {
OFFreeMemory(buffer);
@throw e;
}
return ret;
}
- (id)copy
{
return [self retain];
}
|
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
|
811
812
813
814
815
816
817
818
819
820
821
822
823
824
|
-
-
-
-
-
-
-
-
|
OFMutableArray *ret = [[self mutableCopy] autorelease];
[ret addObjectsFromArray: array];
[ret makeImmutable];
return ret;
}
- (OFArray *)arrayByRemovingObject: (id)object
{
OFMutableArray *ret = [[self mutableCopy] autorelease];
[ret removeObject: object];
[ret makeImmutable];
return ret;
}
#ifdef OF_HAVE_BLOCKS
- (OFArray *)mappedArrayUsingBlock: (OFArrayMapBlock)block
{
OFArray *ret;
size_t count = self.count;
id *tmp = OFAllocMemory(count, sizeof(id));
|