Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
bpoplauschi committed Oct 25, 2015
1 parent 6406d8e commit ac98896
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SDWebImage/SDWebImagePrefetcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock

__weak SDWebImagePrefetcher *weakSelf = self;

if(urls.count == 0){
if(completionBlock){
if (urls.count == 0) {
if (completionBlock) {
completionBlock(0,0);
}
}else{
} else {
// http://oleb.net/blog/2013/07/parallelize-for-loops-gcd-dispatch_apply/
// Optimize the maxConcurrentdownloads for effeciency. Since caching operations are involved that are non-trivial using
// dispatch_apply might be helpful.
Expand All @@ -128,9 +128,9 @@ - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock
dispatch_apply(maxNumberOfImages/self.maxConcurrentDownloads, dispatch_get_global_queue(self.prefetcherQueue, 0), ^(size_t index) {
size_t i = index * self.maxConcurrentDownloads;
size_t stop = i + self.maxConcurrentDownloads;
do{
do {
[weakSelf startPrefetchingAtIndex:i++];
}while (i < stop);
} while (i < stop);
});

// Download remaining images.
Expand Down

0 comments on commit ac98896

Please sign in to comment.