ObjFW  Diff

Differences From Artifact [d65c9872b3]:

To Artifact [cdb0c9cc7a]:


208
209
210
211
212
213
214

215
216
217
218
219
220
221
222

- (void)getObjects: (id*)buffer
	   inRange: (of_range_t)range
{
	id *objects = [array cArray];
	size_t i, count = [array count];


	if (range.location + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	for (i = 0; i < range.length; i++)
		buffer[i] = objects[range.location + i];
}

- (size_t)indexOfObject: (id)object







>
|







208
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.length > SIZE_MAX - range.location ||
	    range.location + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	for (i = 0; i < range.length; i++)
		buffer[i] = objects[range.location + i];
}

- (size_t)indexOfObject: (id)object
242
243
244
245
246
247
248

249


250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268

	return OF_NOT_FOUND;
}


- (OFArray*)objectsInRange: (of_range_t)range
{

	size_t count;



	if (![self isKindOfClass: [OFMutableArray class]])
		return [OFArray_adjacentSubarray arrayWithArray: self
							  range: range];

	count = [array count];

	if (range.location + range.length > count)
		@throw [OFOutOfRangeException exceptionWithClass: [self class]];

	return [OFArray arrayWithObjects: (id*)[array cArray] + range.location
				   count: range.length];
}

- (BOOL)isEqual: (id)object
{
	OFArray *otherArray;
	id *objects, *otherObjects;
	size_t i, count;







>
|
>
>

|
|
<
|
<
<
|
<

|
|







243
244
245
246
247
248
249
250
251
252
253
254
255
256

257


258

259
260
261
262
263
264
265
266
267
268

	return OF_NOT_FOUND;
}


- (OFArray*)objectsInRange: (of_range_t)range
{
	if (range.length > SIZE_MAX - range.location ||
	    range.location + range.length > [array count])
		@throw [OFOutOfRangeException
		    exceptionWithClass: [self class]];

	if ([self isKindOfClass: [OFMutableArray class]])
		return [OFArray

		    arrayWithObjects: (id*)[array cArray] + range.location


			       count: range.length];


	return [OFArray_adjacentSubarray arrayWithArray: self
						  range: range];
}

- (BOOL)isEqual: (id)object
{
	OFArray *otherArray;
	id *objects, *otherObjects;
	size_t i, count;