mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-13 00:29:14 +00:00
Don't repeat constant.
This commit is contained in:
parent
84ea04f61d
commit
a6ba549b67
@ -50,12 +50,19 @@ struct HitRate {
|
||||
[items addObject:[path stringByAppendingPathComponent:diskItem]];
|
||||
}
|
||||
|
||||
dispatch_apply(([items count] + 9) / 10, dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^(size_t iteration) {
|
||||
const auto base = iteration * 10;
|
||||
for(size_t index = base; index < base + 10 && index < [items count]; index++) {
|
||||
static constexpr int BatchSize = 10;
|
||||
dispatch_apply(
|
||||
([items count] + BatchSize - 1) / BatchSize,
|
||||
dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0),
|
||||
^(size_t iteration) {
|
||||
|
||||
const auto base = iteration * BatchSize;
|
||||
for(size_t index = base; index < base + BatchSize && index < [items count]; index++) {
|
||||
NSString *const fullPath = [items objectAtIndex:index];
|
||||
|
||||
NSLog(@"Starting %@", fullPath);
|
||||
const auto list = Analyser::Static::GetTargets(fullPath.UTF8String);
|
||||
NSLog(@"Ending %@", fullPath);
|
||||
if(list.empty()) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user