Change to always return SDImageCacheTypeDisk cache type when querying memory cache (unless user cancel the query)

This commit is contained in:
DreamPiggy 2020-08-27 11:08:12 +08:00
parent 2c9eaccf23
commit bcda3f5000
1 changed files with 2 additions and 3 deletions

View File

@ -539,14 +539,13 @@ static NSString * _defaultDiskCacheDirectory;
[self.memoryCache setObject:diskImage forKey:key cost:cost]; [self.memoryCache setObject:diskImage forKey:key cost:cost];
} }
} }
SDImageCacheType cacheType = diskImage ? SDImageCacheTypeDisk : SDImageCacheTypeNone;
if (doneBlock) { if (doneBlock) {
if (shouldQueryDiskSync) { if (shouldQueryDiskSync) {
doneBlock(diskImage, diskData, cacheType); doneBlock(diskImage, diskData, SDImageCacheTypeDisk);
} else { } else {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
doneBlock(diskImage, diskData, cacheType); doneBlock(diskImage, diskData, SDImageCacheTypeDisk);
}); });
} }
} }