Authored by Bogdan Poplauschi

Removed sync method `diskImageExistsWithKey:` from `SDImageCache`

@@ -227,15 +227,6 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot @@ -227,15 +227,6 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot
227 - (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock; 227 - (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock;
228 228
229 /** 229 /**
230 - * Check if image exists in disk cache already (does not load the image)  
231 - *  
232 - * @param key the key describing the url  
233 - *  
234 - * @return YES if an image exists for the given key  
235 - */  
236 -- (BOOL)diskImageExistsWithKey:(nullable NSString *)key;  
237 -  
238 -/**  
239 * Get the cache path for a certain key (needs the cache path root folder) 230 * Get the cache path for a certain key (needs the cache path root folder)
240 * 231 *
241 * @param key the key (can be obtained from url using cacheKeyForURL) 232 * @param key the key (can be obtained from url using cacheKeyForURL)
@@ -231,21 +231,6 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @@ -231,21 +231,6 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
231 } 231 }
232 } 232 }
233 233
234 -- (BOOL)diskImageExistsWithKey:(nullable NSString *)key {  
235 - BOOL exists = NO;  
236 -  
237 - // this is an exception to access the filemanager on another queue than ioQueue, but we are using the shared instance  
238 - // from apple docs on NSFileManager: The methods of the shared NSFileManager object can be called from multiple threads safely.  
239 - exists = [[NSFileManager defaultManager] fileExistsAtPath:[self defaultCachePathForKey:key]];  
240 -  
241 - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name  
242 - // checking the key with and without the extension  
243 - if (!exists) {  
244 - exists = [[NSFileManager defaultManager] fileExistsAtPath:[self defaultCachePathForKey:key].stringByDeletingPathExtension];  
245 - }  
246 -  
247 - return exists;  
248 -}  
249 234
250 - (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock { 235 - (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock {
251 dispatch_async(_ioQueue, ^{ 236 dispatch_async(_ioQueue, ^{