|
@@ -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, ^{
|