ObjFW  Diff

Differences From Artifact [654b3f415b]:

To Artifact [e5f9ad914b]:


398
399
400
401
402
403
404




















405
406
407
408
409
410
411
	id *objs = [array cArray];
	size_t i, count = [array count];
	BOOL stop = NO;

	for (i = 0; i < count && !stop; i++)
		block(objs[i], i, &stop);
}





















- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block
{
	size_t count = [array count];
	id *tmp = [self allocMemoryForNItems: count
				    withSize: sizeof(id)];








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
	id *objs = [array cArray];
	size_t i, count = [array count];
	BOOL stop = NO;

	for (i = 0; i < count && !stop; i++)
		block(objs[i], i, &stop);
}

- (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block
{
	size_t count = [array count];
	id *tmp = [self allocMemoryForNItems: count
				    withSize: sizeof(id)];

	@try {
		id *objs = [array cArray];
		size_t i;

		for (i = 0; i < count; i++)
			tmp[i] = block(objs[i], i);

		return [OFArray arrayWithCArray: tmp
					 length: count];
	} @finally {
		[self freeMemory: tmp];
	}
}

- (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block
{
	size_t count = [array count];
	id *tmp = [self allocMemoryForNItems: count
				    withSize: sizeof(id)];