Oolite
Loading...
Searching...
No Matches
OOWeakSet(OOPrivate) Category Reference

Instance Methods

(void) - compact

Detailed Description

Definition at line 23 of file OOWeakSet.m.

Method Documentation

◆ compact

- (void) compact

Extends class OOWeakSet.

Definition at line 214 of file OOWeakSet.m.

215{
216 OOWeakReference* weakRef = nil;
217 BOOL compactRequired = NO;
218 foreach (weakRef, _objects) {
219 if ([weakRef weakRefUnderlyingObject] == nil) {
220 compactRequired = YES;
221 break;
222 }
223 }
224
225 if (compactRequired) {
226 NSMutableSet* newObjects = [[NSMutableSet alloc] initWithCapacity:[_objects count]];
227 foreach (weakRef, _objects) {
228 if ([weakRef weakRefUnderlyingObject] != nil) {
229 [newObjects addObject:weakRef];
230 }
231 }
232
233 [_objects release];
234 _objects = newObjects;
235 }
236}
return nil

References compact, and nil.

Referenced by OOWeakSet::addObjectsByEnumerating:, compact, OOWeakSet::containsObject:, OOWeakSet::copyWithZone:, and OOWeakSet::count.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this category was generated from the following file: