Remove the extra __block mark and the early weakOperation define

This commit is contained in:
DreamPiggy 2018-01-20 15:03:31 +08:00
parent 3b4dd0b184
commit 4e5af52fd0
1 changed files with 3 additions and 3 deletions

View File

@ -125,9 +125,8 @@
url = nil;
}
__block SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new];
SDWebImageCombinedOperation *operation = [SDWebImageCombinedOperation new];
operation.manager = self;
__weak SDWebImageCombinedOperation *weakOperation = operation;
BOOL isFailedUrl = NO;
if (url) {
@ -150,7 +149,8 @@
if (options & SDWebImageCacheMemoryOnly) cacheOptions |= SDImageCacheQueryMemoryOnly;
if (options & SDWebImageQueryDataWhenInMemory) cacheOptions |= SDImageCacheQueryDataWhenInMemory;
if (options & SDWebImageQueryDiskSync) cacheOptions |= SDImageCacheQueryDiskSync;
__weak SDWebImageCombinedOperation *weakOperation = operation;
operation.cacheOperation = [self.imageCache queryCacheOperationForKey:key options:cacheOptions done:^(UIImage *cachedImage, NSData *cachedData, SDImageCacheType cacheType) {
__strong __typeof(weakOperation) strongOperation = weakOperation;
if (!strongOperation || strongOperation.isCancelled) {