Merge pull request #1212 from binl/bl_fix_allocator_subarray

[ASDataController] Fix allocatedNodes Subarray to match indexPaths subarray
This commit is contained in:
appleguy 2016-02-10 11:34:25 -08:00
commit b033b544d5

View File

@ -188,11 +188,11 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
dispatch_semaphore_signal(sema); dispatch_semaphore_signal(sema);
}); });
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
[self layoutLoadedNodes:allocatedNodes ofKind:kind atIndexPaths:[indexPaths subarrayWithRange:NSMakeRange(j, batchCount)]]; [self layoutLoadedNodes:[allocatedNodes subarrayWithRange:NSMakeRange(j, batchCount)] ofKind:kind atIndexPaths:[indexPaths subarrayWithRange:NSMakeRange(j, batchCount)]];
} else { } else {
allocationBlock(); allocationBlock();
[_mainSerialQueue performBlockOnMainThread:^{ [_mainSerialQueue performBlockOnMainThread:^{
[self layoutLoadedNodes:allocatedNodes ofKind:kind atIndexPaths:[indexPaths subarrayWithRange:NSMakeRange(j, batchCount)]]; [self layoutLoadedNodes:[allocatedNodes subarrayWithRange:NSMakeRange(j, batchCount)] ofKind:kind atIndexPaths:[indexPaths subarrayWithRange:NSMakeRange(j, batchCount)]];
}]; }];
} }