424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
-
+
-
+
|
void *pool = objc_autoreleasePoolPush();
id ret = [[[self objectEnumerator] nextObject] retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
#ifdef OF_HAVE_BLOCKS
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block
- (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block
{
bool stop = false;
for (id object in self) {
block(object, &stop);
if (stop)
break;
}
}
- (OFSet *)filteredSetUsingBlock: (of_set_filter_block_t)block
- (OFSet *)filteredSetUsingBlock: (OFSetFilterBlock)block
{
OFMutableSet *ret = [OFMutableSet set];
[self enumerateObjectsUsingBlock: ^ (id object, bool *stop) {
if (block(object))
[ret addObject: object];
}];
|