mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 00:25:09 +00:00
LibRegex: Use proper CharRange constructor instead of bit_casting
Otherwise the range order would be inverted.
This commit is contained in:
parent
c774790975
commit
7d01ee63d6
2 changed files with 3 additions and 2 deletions
|
@ -187,7 +187,7 @@ static bool has_overlap(Vector<CompareTypeAndValuePair> const& lhs, Vector<Compa
|
|||
lhs_negated_char_classes.set(static_cast<CharClass>(pair.value));
|
||||
break;
|
||||
case CharacterCompareType::CharRange: {
|
||||
auto range = bit_cast<CharRange>(pair.value);
|
||||
auto range = CharRange(pair.value);
|
||||
if (!current_lhs_inversion_state())
|
||||
lhs_ranges.insert(range.from, range.to);
|
||||
else
|
||||
|
@ -257,7 +257,7 @@ static bool has_overlap(Vector<CompareTypeAndValuePair> const& lhs, Vector<Compa
|
|||
return true;
|
||||
break;
|
||||
case CharacterCompareType::CharRange: {
|
||||
auto range = bit_cast<CharRange>(pair.value);
|
||||
auto range = CharRange(pair.value);
|
||||
if (!current_lhs_inversion_state() && range_contains(range))
|
||||
return true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue