Regex: do not decode utf8 in accept calls as they always run on ascii

This commit is contained in:
Maxime Coste 2017-11-25 18:13:27 +08:00
parent ec6ecd5772
commit 0d44cf9591

View File

@ -187,13 +187,13 @@ private:
bool accept(StringView expected) bool accept(StringView expected)
{ {
auto it = m_pos; auto it = m_pos.base();
for (Iterator expected_it{expected.begin(), expected}; expected_it != expected.end(); ++expected_it) for (auto expected_it = expected.begin(); expected_it != expected.end(); ++expected_it)
{ {
if (it == m_regex.end() or *it++ != *expected_it) if (it == m_regex.end() or *it++ != *expected_it)
return false; return false;
} }
m_pos = it; m_pos = Iterator{it, m_regex};
return true; return true;
} }