Skip to content

Commit 34c88e3

Browse files
pthomDobiasd
authored andcommitted
1 parent ec0fb00 commit 34c88e3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

include/fplus/container_common.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,10 +1278,11 @@ std::pair<Container, Container> unweave(const Container& xs)
12781278
auto it_odd = internal::get_back_inserter<Container>(result.second);
12791279
std::size_t counter = 0;
12801280
for (const auto& x : xs) {
1281-
if (counter++ % 2 == 0)
1281+
if (counter % 2 == 0)
12821282
*it_even = x;
12831283
else
12841284
*it_odd = x;
1285+
counter++;
12851286
}
12861287
return result;
12871288
}

include_all_in_one/include/fplus/fplus.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4373,10 +4373,11 @@ std::pair<Container, Container> unweave(const Container& xs)
43734373
auto it_odd = internal::get_back_inserter<Container>(result.second);
43744374
std::size_t counter = 0;
43754375
for (const auto& x : xs) {
4376-
if (counter++ % 2 == 0)
4376+
if (counter % 2 == 0)
43774377
*it_even = x;
43784378
else
43794379
*it_odd = x;
4380+
counter++;
43804381
}
43814382
return result;
43824383
}

0 commit comments

Comments
 (0)