ObjFW  Diff

Differences From Artifact [12cfe037e0]:

To Artifact [3e40ae1337]:


358
359
360
361
362
363
364
365

366
367
368
369
370
371
372
373

374
375

376
377
378






379
380
381
382
383
384
385
358
359
360
361
362
363
364

365
366
367



368
369

370
371
372
373



374
375
376
377
378
379
380
381
382
383
384
385
386







-
+


-
-
-


-
+


+
-
-
-
+
+
+
+
+
+







	[element retain];
	[pool release];
	[element autorelease];

	return element;
}

#ifdef OF_HAVE_BLOCKS
#if defined(OF_HAVE_BLOCKS) && defined(OF_HAVE_FAST_ENUMERATION)
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFEnumerator *enumerator = [self objectEnumerator];
	id object;
	BOOL stop = NO;

	while (!stop && (object = [enumerator nextObject]) != nil)
	for (id object in self) {
		block(object, &stop);

		if (stop)
	[pool release];
}

			break;
	}
}
#endif

#ifdef OF_HAVE_BLOCKS
- (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block
{
	OFMutableSet *ret = [OFMutableSet set];

	[self enumerateObjectsUsingBlock: ^ (id object, BOOL *stop) {
		if (block(object))
			[ret addObject: object];