mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: CoLoop -> CoFor rename
git-svn-id: svn://ultimatepp.org/upp/trunk@10405 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
93270433a6
commit
fe30eecc59
1 changed files with 6 additions and 6 deletions
|
|
@ -5,7 +5,7 @@ inline size_t CoChunk__(C count, MC max_chunk)
|
|||
}
|
||||
|
||||
template <class Iter, class Lambda>
|
||||
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 <class Range, class Lambda>
|
||||
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<Range> CoSum(const Range& r, const ValueTypeOf<Range>& zero)
|
|||
typedef ValueTypeOf<Range> VT;
|
||||
typedef ConstIteratorOf<Range> 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<Range> 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<int> found;
|
||||
found = count;
|
||||
CoIterate(from, count,
|
||||
CoFor(from, count,
|
||||
[=, &found](int i0, int e0) {
|
||||
auto i = r.begin() + i0;
|
||||
auto e = r.begin() + e0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue