Scope like a boss

This commit is contained in:
Adlai Holler
2015-11-29 21:22:37 -08:00
parent ebf8da9b55
commit fca8614c18

View File

@@ -276,16 +276,15 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
- (void)setImageIdentifiers:(NSArray *)imageIdentifiers
{
_imageIdentifiersLock.lock();
{
ASDN::MutexLocker l(_imageIdentifiersLock);
if (ASObjectIsEqual(_imageIdentifiers, imageIdentifiers)) {
return;
}
if (ASObjectIsEqual(_imageIdentifiers, imageIdentifiers)) {
_imageIdentifiersLock.unlock();
return;
_imageIdentifiers = [[NSArray alloc] initWithArray:imageIdentifiers copyItems:YES];
}
_imageIdentifiers = [[NSArray alloc] initWithArray:imageIdentifiers copyItems:YES];
_imageIdentifiersLock.unlock();
if (self.interfaceState & ASInterfaceStateFetchData) {
[self fetchData];
}