Merge pull request #464 from ianolito/lazy-pending-nodes-set

Create pending nodes set lazily
This commit is contained in:
appleguy 2015-06-06 19:23:59 -07:00
commit fded84806b

View File

@ -116,8 +116,6 @@ void ASDisplayNodePerformBlockOnMainThread(void (^block)())
_contentsScaleForDisplay = ASDisplayNodeScreenScale(); _contentsScaleForDisplay = ASDisplayNodeScreenScale();
_displaySentinel = [[ASSentinel alloc] init]; _displaySentinel = [[ASSentinel alloc] init];
_pendingDisplayNodes = [[NSMutableSet alloc] init];
_flags.isInHierarchy = NO; _flags.isInHierarchy = NO;
_flags.displaysAsynchronously = YES; _flags.displaysAsynchronously = YES;
@ -1218,6 +1216,10 @@ static NSInteger incrementIfFound(NSInteger i) {
{ {
ASDN::MutexLocker l(_propertyLock); ASDN::MutexLocker l(_propertyLock);
if (!_pendingDisplayNodes) {
_pendingDisplayNodes = [[NSMutableSet alloc] init];
}
[_pendingDisplayNodes addObject:node]; [_pendingDisplayNodes addObject:node];
} }