Code style

This commit is contained in:
Bogdan Poplauschi 2015-10-25 19:32:31 +02:00
parent 6406d8e526
commit ac98896099
1 changed files with 5 additions and 5 deletions

View File

@ -114,11 +114,11 @@
__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.
@ -128,9 +128,9 @@
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.