From bcda3f5000adc378773784c7808a2d8a874250b8 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 27 Aug 2020 11:08:12 +0800 Subject: [PATCH] Change to always return SDImageCacheTypeDisk cache type when querying memory cache (unless user cancel the query) --- SDWebImage/Core/SDImageCache.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SDWebImage/Core/SDImageCache.m b/SDWebImage/Core/SDImageCache.m index f197f596..c2f18a9d 100644 --- a/SDWebImage/Core/SDImageCache.m +++ b/SDWebImage/Core/SDImageCache.m @@ -539,14 +539,13 @@ static NSString * _defaultDiskCacheDirectory; [self.memoryCache setObject:diskImage forKey:key cost:cost]; } } - SDImageCacheType cacheType = diskImage ? SDImageCacheTypeDisk : SDImageCacheTypeNone; if (doneBlock) { if (shouldQueryDiskSync) { - doneBlock(diskImage, diskData, cacheType); + doneBlock(diskImage, diskData, SDImageCacheTypeDisk); } else { dispatch_async(dispatch_get_main_queue(), ^{ - doneBlock(diskImage, diskData, cacheType); + doneBlock(diskImage, diskData, SDImageCacheTypeDisk); }); } }