Browse Source

Fix endless loop; need to be more thorough with unit tests...

master
Jessica James 3 years ago
parent
commit
9d5d8b0abb
  1. 2
      src/include/jessilib/split.hpp
  2. 2
      src/include/jessilib/word_split.hpp

2
src/include/jessilib/split.hpp

@ -249,7 +249,7 @@ constexpr auto split_once(ItrT begin, EndT end, DelimItrT in_delim_begin, DelimE
}
auto itr_end = end - (delim_length - 1);
for (auto itr = begin; itr < itr_end;) {
for (auto itr = begin; itr < itr_end; ++itr) {
if (std::equal(in_delim_begin, in_delim_end, itr)) {
// in_delim found; split upon it
result.first = make_split_member<MemberT>(begin, itr);

2
src/include/jessilib/word_split.hpp

@ -300,7 +300,7 @@ constexpr auto word_split_once(ItrT begin, EndT end, SpaceItrT in_whitespace_beg
++begin;
}
for (auto itr = begin; itr < end;) {
for (auto itr = begin; itr < end; ++itr) {
if (is_whitespace(*itr)) {
// in_whitespace found; word_split upon it
result.first = make_word_split_member<MemberT>(begin, itr);

Loading…
Cancel
Save