Regex: slight readability improvement and workaround a potential gcc bug

This commit is contained in:
Maxime Coste 2017-10-23 17:00:42 +08:00
parent f07375fb27
commit 2d901dc76f

View File

@ -449,10 +449,11 @@ private:
{ {
if (pos == (look_direction == MatchDirection::Forward ? m_end : m_begin)) if (pos == (look_direction == MatchDirection::Forward ? m_end : m_begin))
return false; return false;
auto cp = (look_direction == MatchDirection::Forward ? *pos : *(pos-1)), ref = *it; Codepoint cp = (look_direction == MatchDirection::Forward ? *pos : *(pos-1));
if (ignore_case) if (ignore_case)
cp = to_lower(cp); cp = to_lower(cp);
const Codepoint ref = *it;
if (ref == 0xF000) if (ref == 0xF000)
{} // any character matches {} // any character matches
else if (ref > 0xF0000 and ref <= 0xFFFFD) else if (ref > 0xF0000 and ref <= 0xFFFFD)