diff --git a/uppsrc/Core/CoAlgo.h b/uppsrc/Core/CoAlgo.h index 963ede15f..9c5d90568 100644 --- a/uppsrc/Core/CoAlgo.h +++ b/uppsrc/Core/CoAlgo.h @@ -5,7 +5,7 @@ inline size_t CoChunk__(C count, MC max_chunk) } template -void CoIterate(Iter begin, Iter end, const Lambda& lambda, int max_chunk = INT_MAX) +void CoFor(Iter begin, Iter end, const Lambda& lambda, int max_chunk = INT_MAX) { size_t chunk = CoChunk__(end - begin, max_chunk); CoWork co; @@ -19,9 +19,9 @@ void CoIterate(Iter begin, Iter end, const Lambda& lambda, int max_chunk = INT_M } template -void CoFor(Range& r, const Lambda& lambda, int max_chunk = INT_MAX) +void CoFor(Range& r, const Lambda& lambda) { - size_t chunk = CoChunk__(r.GetCount(), max_chunk); + size_t chunk = CoChunk__(r.GetCount(), INT_MAX); CoWork co; auto begin = r.begin(); auto end = r.end(); @@ -71,7 +71,7 @@ ValueTypeOf CoSum(const Range& r, const ValueTypeOf& zero) typedef ValueTypeOf VT; typedef ConstIteratorOf I; VT sum = zero; - CoIterate(r.begin(), r.end(), + CoFor(r.begin(), r.end(), [=, &sum](I i, I e) { VT h = zero; while(i < e) @@ -96,7 +96,7 @@ int CoFindBest(const Range& r, const Better& better) return -1; typedef ConstIteratorOf I; I best = r.begin(); - CoIterate(r.begin() + 1, r.end(), + CoFor(r.begin() + 1, r.end(), [=, &best](I i, I e) { I b = i++; while(i < e) { @@ -157,7 +157,7 @@ int CoFindMatch(const Range& r, const Match& eq, int from = 0) int count = r.GetCount(); std::atomic found; found = count; - CoIterate(from, count, + CoFor(from, count, [=, &found](int i0, int e0) { auto i = r.begin() + i0; auto e = r.begin() + e0;