Commit fff851b0 by Dima Bart

Refactor dependency linking logic.

parent 417aa701
......@@ -25,6 +25,7 @@
//
#import "BUYGroupOperation.h"
#import "NSArray+BUYAdditions.h"
@interface BUYGroupOperation ()
......@@ -96,14 +97,12 @@
- (void)linkDependencies
{
if (self.operations.count > 1) {
int i = (int)self.operations.count - 1;
while (i > 0) {
NSOperation *latter = self.operations[i];
NSOperation *former = self.operations[i - 1];
NSArray *tail = [self.operations buy_tail];
if (tail.count > 0) {
NSOperation *former = self.operations.firstObject;
for (NSOperation *latter in tail) {
[latter addDependency:former];
i--;
former = latter;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment