From 0d44cf95917a6f612550a239ab4a25375b3c6012 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 25 Nov 2017 18:13:27 +0800 Subject: [PATCH] Regex: do not decode utf8 in accept calls as they always run on ascii --- src/regex_impl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 729519a8..3197292d 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -187,13 +187,13 @@ private: bool accept(StringView expected) { - auto it = m_pos; - for (Iterator expected_it{expected.begin(), expected}; expected_it != expected.end(); ++expected_it) + auto it = m_pos.base(); + for (auto expected_it = expected.begin(); expected_it != expected.end(); ++expected_it) { if (it == m_regex.end() or *it++ != *expected_it) return false; } - m_pos = it; + m_pos = Iterator{it, m_regex}; return true; }