mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-05 21:32:55 +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]];
|
[items addObject:[path stringByAppendingPathComponent:diskItem]];
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_apply(([items count] + 9) / 10, dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^(size_t iteration) {
|
static constexpr int BatchSize = 10;
|
||||||
const auto base = iteration * 10;
|
dispatch_apply(
|
||||||
for(size_t index = base; index < base + 10 && index < [items count]; index++) {
|
([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];
|
NSString *const fullPath = [items objectAtIndex:index];
|
||||||
|
|
||||||
|
NSLog(@"Starting %@", fullPath);
|
||||||
const auto list = Analyser::Static::GetTargets(fullPath.UTF8String);
|
const auto list = Analyser::Static::GetTargets(fullPath.UTF8String);
|
||||||
|
NSLog(@"Ending %@", fullPath);
|
||||||
if(list.empty()) {
|
if(list.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user