Regex: do not decode utf8 in accept calls as they always run on ascii
This commit is contained in:
parent
ec6ecd5772
commit
0d44cf9591
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user