From 57ebdeafcf7d666d0c76cafe67972a39da3e070a Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Tue, 12 Sep 2023 14:39:12 +0800 Subject: [PATCH] Fix one warning because local variable shadows the variable outside of block --- SDWebImage/Core/SDImageCache.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDWebImage/Core/SDImageCache.m b/SDWebImage/Core/SDImageCache.m index da393b85..ac6097b2 100644 --- a/SDWebImage/Core/SDImageCache.m +++ b/SDWebImage/Core/SDImageCache.m @@ -269,9 +269,9 @@ static NSString * _defaultDiskCacheDirectory; format = [SDImageCoderHelper CGImageContainsAlpha:image.CGImage] ? SDImageFormatPNG : SDImageFormatJPEG; } } - NSData *data = [[SDImageCodersManager sharedManager] encodedDataWithImage:image format:format options:context[SDWebImageContextImageEncodeOptions]]; + NSData *encodedData = [[SDImageCodersManager sharedManager] encodedDataWithImage:image format:format options:context[SDWebImageContextImageEncodeOptions]]; dispatch_async(self.ioQueue, ^{ - [self _storeImageDataToDisk:data forKey:key]; + [self _storeImageDataToDisk:encodedData forKey:key]; [self _archivedDataWithImage:image forKey:key]; if (completionBlock) { [(queue ?: SDCallbackQueue.mainQueue) async:^{