Using indexesOfObjectsPassingTest to calculate numberOfFinishedOperations in -enqueueBatchOfHTTPRequestOperations:
Signed-off-by: Mattt Thompson <m@mattt.me>
This commit is contained in:
parent
25dcdcaf75
commit
7207f2f19f
1 changed files with 3 additions and 6 deletions
|
|
@ -605,12 +605,9 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
originalCompletionBlock();
|
originalCompletionBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
NSUInteger numberOfFinishedOperations = 0;
|
NSInteger numberOfFinishedOperations = [[operations indexesOfObjectsPassingTest:^BOOL(id op, NSUInteger idx, BOOL *stop) {
|
||||||
for (NSOperation *operation in operations) {
|
return [op isCancelled];
|
||||||
if (operation.isFinished) {
|
}] count];
|
||||||
numberOfFinishedOperations++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (progressBlock) {
|
if (progressBlock) {
|
||||||
progressBlock(numberOfFinishedOperations, [operations count]);
|
progressBlock(numberOfFinishedOperations, [operations count]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue