зеркало из https://github.com/github/AFNetworking.git
Using indexesOfObjectsPassingTest to calculate numberOfFinishedOperations in -enqueueBatchOfHTTPRequestOperations:
Signed-off-by: Mattt Thompson <m@mattt.me>
This commit is contained in:
Родитель
25dcdcaf75
Коммит
7207f2f19f
|
@ -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]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче