Merge pull request #2641 from Insofan/5.x

simplify assign downloaderOperation's minimumProgressInterval code
This commit is contained in:
DreamPiggy 2019-03-14 21:40:34 +08:00 committed by GitHub
commit e36c505b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -291,9 +291,7 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext;
} }
if ([operation respondsToSelector:@selector(setMinimumProgressInterval:)]) { if ([operation respondsToSelector:@selector(setMinimumProgressInterval:)]) {
NSTimeInterval minimumProgressInterval = self.config.minimumProgressInterval; operation.minimumProgressInterval = MIN(MAX(self.config.minimumProgressInterval, 0), 1);
minimumProgressInterval = MIN(MAX(minimumProgressInterval, 0), 1);
operation.minimumProgressInterval = minimumProgressInterval;
} }
if (options & SDWebImageDownloaderHighPriority) { if (options & SDWebImageDownloaderHighPriority) {