Oolite 1.91.0.7668-250429-8542c40
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
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 239 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

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: