237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
for (size_t i = 0; i < range.length; i++)
buffer[i] = [self objectAtIndex: range.location + i];
}
- (id const *)objects
{
size_t count = self.count;
OFMutableData *data = [OFMutableData dataWithItemSize: sizeof(id)
capacity: count];
id *buffer;
[data increaseCountBy: count];
buffer = data.mutableItems;
[self getObjects: buffer
inRange: of_range(0, count)];
return buffer;
}
- (id)copy
{
return [self retain];
}
|
<
<
|
<
<
>
|
|
>
>
>
|
|
>
>
>
>
|
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
264
|
for (size_t i = 0; i < range.length; i++)
buffer[i] = [self objectAtIndex: range.location + i];
}
- (id const *)objects
{
size_t count = self.count;
id *buffer = of_malloc(count, sizeof(id));
@try {
[self getObjects: buffer
inRange: of_range(0, count)];
} @catch (id e) {
free(buffer);
@throw e;
}
return [OFData dataWithItemsNoCopy: buffer
itemSize: sizeof(id)
count: count
freeWhenDone: true].items;
}
- (id)copy
{
return [self retain];
}
|