From a4751a652f6dc47419651c560f8e724fc87ab91d Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 24 Jul 2017 20:46:31 +0800 Subject: [PATCH] Small change Small change --- SDWebImage/SDImageCache.m | 3 +-- SDWebImage/SDWebImageCompat.m | 3 +-- SDWebImage/SDWebImageDownloader.m | 5 ++--- SDWebImage/SDWebImageDownloaderOperation.m | 3 +-- SDWebImage/SDWebImagePrefetcher.h | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 61a8bfe4..acd3f2b2 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -351,8 +351,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { image = [UIImage decodedImageWithImage:image]; } return image; - } - else { + } else { return nil; } } diff --git a/SDWebImage/SDWebImageCompat.m b/SDWebImage/SDWebImageCompat.m index ade04be1..b0409926 100644 --- a/SDWebImage/SDWebImageCompat.m +++ b/SDWebImage/SDWebImageCompat.m @@ -28,8 +28,7 @@ inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullabl } return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; - } - else { + } else { #if SD_WATCH if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { #elif SD_UIKIT diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index c389946c..29e7d59d 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -119,8 +119,7 @@ - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { if (value) { self.HTTPHeaders[field] = value; - } - else { + } else { [self.HTTPHeaders removeObjectForKey:field]; } } @@ -264,7 +263,7 @@ } - (void)setSuspended:(BOOL)suspended { - (self.downloadQueue).suspended = suspended; + self.downloadQueue.suspended = suspended; } - (void)cancelAllDownloads { diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 388a76ba..6c7dd55f 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -272,8 +272,7 @@ didReceiveResponse:(NSURLResponse *)response dispatch_async(dispatch_get_main_queue(), ^{ [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:weakSelf]; }); - } - else { + } else { NSUInteger code = ((NSHTTPURLResponse *)response).statusCode; //This is the case when server returns '304 Not Modified'. It means that remote image is not changed. diff --git a/SDWebImage/SDWebImagePrefetcher.h b/SDWebImage/SDWebImagePrefetcher.h index d0a91ed7..c299de17 100644 --- a/SDWebImage/SDWebImagePrefetcher.h +++ b/SDWebImage/SDWebImagePrefetcher.h @@ -61,7 +61,7 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, /** * Queue options for Prefetcher. Defaults to Main Queue. */ -@property (nonatomic, assign, nonnull) dispatch_queue_t prefetcherQueue; +@property (SDDispatchQueueSetterSementics, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; @property (weak, nonatomic, nullable) id delegate;