diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 24167c14..4a94a792 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -21,7 +21,7 @@ @property (strong, nonatomic, readwrite) SDImageCache *imageCache; @property (strong, nonatomic, readwrite) SDWebImageDownloader *imageDownloader; -@property (strong, nonatomic) NSMutableArray *failedURLs; +@property (strong, nonatomic) NSMutableSet *failedURLs; @property (strong, nonatomic) NSMutableArray *runningOperations; @end @@ -41,7 +41,7 @@ if ((self = [super init])) { _imageCache = [self createCache]; _imageDownloader = [SDWebImageDownloader sharedDownloader]; - _failedURLs = [NSMutableArray new]; + _failedURLs = [NSMutableSet new]; _runningOperations = [NSMutableArray new]; } return self; @@ -194,9 +194,7 @@ if (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut) { @synchronized (self.failedURLs) { - if (![self.failedURLs containsObject:url]) { - [self.failedURLs addObject:url]; - } + [self.failedURLs addObject:url]; } } }