From 537b039012ace8c033b4cda94c4741e755cb14c1 Mon Sep 17 00:00:00 2001 From: Bogdan Poplauschi Date: Fri, 23 Sep 2016 23:53:18 +0300 Subject: [PATCH] Got rid of `removeImageForKey:` and `removeImageForKey:fromDisk:` that looked sync but were async. Left only the 2 async ones --- SDWebImage/SDImageCache.h | 15 --------------- SDWebImage/SDImageCache.m | 9 --------- 2 files changed, 24 deletions(-) diff --git a/SDWebImage/SDImageCache.h b/SDWebImage/SDImageCache.h index f308689c..623a7274 100644 --- a/SDWebImage/SDImageCache.h +++ b/SDWebImage/SDImageCache.h @@ -181,13 +181,6 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot #pragma mark - Remove Ops -/** - * Remove the image from memory and disk cache asynchronously - * - * @param key The unique image cache key - */ -- (void)removeImageForKey:(nullable NSString *)key; - /** * Remove the image from memory and disk cache asynchronously * @@ -196,14 +189,6 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot */ - (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion; -/** - * Remove the image from memory and optionally disk cache asynchronously - * - * @param key The unique image cache key - * @param fromDisk Also remove cache entry from disk if YES - */ -- (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk; - /** * Remove the image from memory and optionally disk cache asynchronously * diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 531e17c3..64b31128 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -404,20 +404,11 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { #pragma mark - Remove Ops -- (void)removeImageForKey:(nullable NSString *)key { - [self removeImageForKey:key withCompletion:nil]; -} - - (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion { [self removeImageForKey:key fromDisk:YES withCompletion:completion]; } -- (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk { - [self removeImageForKey:key fromDisk:fromDisk withCompletion:nil]; -} - - (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion { - if (key == nil) { return; }