From 9d5d8b0abba01eaccd15d79ef63d2f7d13e94b50 Mon Sep 17 00:00:00 2001 From: Jessica James Date: Sun, 28 Nov 2021 01:22:50 -0600 Subject: [PATCH] Fix endless loop; need to be more thorough with unit tests... --- src/include/jessilib/split.hpp | 2 +- src/include/jessilib/word_split.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/jessilib/split.hpp b/src/include/jessilib/split.hpp index 3e72b6a..81f83c9 100644 --- a/src/include/jessilib/split.hpp +++ b/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(begin, itr); diff --git a/src/include/jessilib/word_split.hpp b/src/include/jessilib/word_split.hpp index 7a4e5e3..433e57b 100644 --- a/src/include/jessilib/word_split.hpp +++ b/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(begin, itr);