Skip to content

Commit

Permalink
Update single header
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbrindle authored and github-actions[bot] committed Nov 28, 2023
1 parent 7b4cdf6 commit 9c3c618
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions single_include/flux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5692,12 +5692,12 @@ inline constexpr struct advance_fn {
constexpr auto operator()(Seq& seq, cursor_t<Seq>& cur, distance_t offset) const -> distance_t
{
if (offset > 0) {
while (--offset >= 0) {
if (flux::is_last(seq, flux::inc(seq, cur))) {
break;
}
distance_t counter = 0;
while (offset-- > 0 && !flux::is_last(seq, cur)) {
flux::inc(seq, cur);
++counter;
}
return offset;
return counter;
} else if (offset < 0) {
if constexpr (bidirectional_sequence<Seq>) {
auto const fst = flux::first(seq);
Expand Down

0 comments on commit 9c3c618

Please sign in to comment.