ObjFW  Diff

Differences From Artifact [eac8a2ce35]:

To Artifact [d8de445b42]:


237
238
239
240
241
242
243
244
245
246

247
248
249
250
251
252
253












254
255
256
257
258
259
260
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;
	OFMutableData *data = [OFMutableData dataWithItemSize: sizeof(id)
						     capacity: count];
	id *buffer;
	id *buffer = of_malloc(count, sizeof(id));

	[data increaseCountBy: count];
	buffer = data.mutableItems;
	[self getObjects: buffer
		 inRange: of_range(0, count)];

	return buffer;
	@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];
}