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();
|
||||
}
|
||||
|
||||
NSUInteger numberOfFinishedOperations = 0;
|
||||
for (NSOperation *operation in operations) {
|
||||
if (operation.isFinished) {
|
||||
numberOfFinishedOperations++;
|
||||
}
|
||||
}
|
||||
NSInteger numberOfFinishedOperations = [[operations indexesOfObjectsPassingTest:^BOOL(id op, NSUInteger idx, BOOL *stop) {
|
||||
return [op isCancelled];
|
||||
}] count];
|
||||
|
||||
if (progressBlock) {
|
||||
progressBlock(numberOfFinishedOperations, [operations count]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue