Skip to content

Commit bf5e25a

Browse files
committed
Further simplify operator++
Remove unnecessary clearing of to_increment_ and clean up logic.
1 parent 8b971fb commit bf5e25a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎include/beman/utf_view/to_utf_view.hpp‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,12 @@ class exposition_only_to_utf_view_impl {
203203
constexpr void exposition_only_advance_one() // @*exposition only*@
204204
requires std::forward_iterator<exposition_only_iter>
205205
{
206-
if (buf_index_ + 1 < buf_last_) {
207-
++buf_index_;
208-
} else {
206+
++buf_index_;
207+
if (buf_index_ == buf_last_) {
208+
buf_index_ = 0;
209209
std::advance(base(), to_increment_);
210-
to_increment_ = 0;
211210
if (base() != end()) {
212211
read();
213-
} else {
214-
buf_index_ = 0;
215212
}
216213
}
217214
}

0 commit comments

Comments
 (0)