Simplify metadata loader

CQTexperiment
Christopher Snowhill 2019-11-08 15:03:26 -08:00
parent 484dd23bf5
commit 4c955ef806
1 changed files with 1 additions and 12 deletions

View File

@ -466,15 +466,8 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
- (void)loadInfoForEntries:(NSArray *)entries
{
NSMutableIndexSet *update_indexes = [[NSMutableIndexSet alloc] init];
long batchCount = ([entries count] / 16) + ([entries count] % 16 ? 1 : 0);
NSMutableArray *array = [[NSMutableArray alloc] init];
long i, j;
for (i = 0; i < batchCount; ++i)
{
[array addObject:[[NSMutableArray alloc] init]];
}
i = 0;
for (PlaylistEntry *pe in entries)
{
@ -482,7 +475,6 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
[update_indexes addIndex:pe.index];
[[array objectAtIndex:i / 16] addObject:pe];
++i;
}
@ -498,11 +490,8 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
__block NSLock *weakLock = outLock;
__block NSMutableArray *weakArray = outArray;
for (NSArray *a in array)
{
if (![a count]) continue;
__block NSArray *weakA = a;
__block NSArray *weakA = entries;
NSBlockOperation *op = [[NSBlockOperation alloc] init];
[op addExecutionBlock:^{