Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOWeakSet(OOPrivate) Category Reference

Instance Methods

(void) - compact
 

Detailed Description

Definition at line 27 of file OOWeakSet.m.

Method Documentation

◆ compact

- (void) compact

Extends class OOWeakSet.

Definition at line 17 of file OOWeakSet.m.

240{
241 OOWeakReference *weakRef = nil;
242 BOOL compactRequired = NO;
243 foreach (weakRef, _objects)
244 {
245 if ([weakRef weakRefUnderlyingObject] == nil)
246 {
247 compactRequired = YES;
248 break;
249 }
250 }
251
252 if (compactRequired)
253 {
254 NSMutableSet *newObjects = [[NSMutableSet alloc] initWithCapacity:[_objects count]];
255 foreach (weakRef, _objects)
256 {
257 if ([weakRef weakRefUnderlyingObject] != nil)
258 {
259 [newObjects addObject:weakRef];
260 }
261 }
262
263 [_objects release];
264 _objects = newObjects;
265 }
266}
return nil

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