Merge pull request #2773 from huangboju/master

Delete unnecessary code
This commit is contained in:
DreamPiggy 2019-06-26 16:06:09 +08:00 committed by GitHub
commit 4ba9befa31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 9 deletions

View File

@ -181,16 +181,11 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
} }
if (self.dataTask) { if (self.dataTask) {
#pragma clang diagnostic push if (self.options & SDWebImageDownloaderHighPriority) {
#pragma clang diagnostic ignored "-Wunguarded-availability" self.dataTask.priority = NSURLSessionTaskPriorityHigh;
if ([self.dataTask respondsToSelector:@selector(setPriority:)]) { } else if (self.options & SDWebImageDownloaderLowPriority) {
if (self.options & SDWebImageDownloaderHighPriority) { self.dataTask.priority = NSURLSessionTaskPriorityLow;
self.dataTask.priority = NSURLSessionTaskPriorityHigh;
} else if (self.options & SDWebImageDownloaderLowPriority) {
self.dataTask.priority = NSURLSessionTaskPriorityLow;
}
} }
#pragma clang diagnostic pop
[self.dataTask resume]; [self.dataTask resume];
for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) {
progressBlock(0, NSURLResponseUnknownLength, self.request.URL); progressBlock(0, NSURLResponseUnknownLength, self.request.URL);