mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
LibRegex: Don't return empty vectors from RegexStringView::lines()
Instead, return a vector of one empty string.
This commit is contained in:
parent
c9d026d7bc
commit
aa20210119
1 changed files with 9 additions and 0 deletions
|
@ -172,6 +172,9 @@ public:
|
|||
return new_views;
|
||||
},
|
||||
[](Utf32View view) {
|
||||
if (view.is_empty())
|
||||
return Vector<RegexStringView> { view };
|
||||
|
||||
Vector<RegexStringView> views;
|
||||
u32 newline = '\n';
|
||||
while (!view.is_empty()) {
|
||||
|
@ -187,6 +190,9 @@ public:
|
|||
return views;
|
||||
},
|
||||
[](Utf16View view) {
|
||||
if (view.is_empty())
|
||||
return Vector<RegexStringView> { view };
|
||||
|
||||
Vector<RegexStringView> views;
|
||||
u16 newline = '\n';
|
||||
while (!view.is_empty()) {
|
||||
|
@ -202,6 +208,9 @@ public:
|
|||
return views;
|
||||
},
|
||||
[](Utf8View const& view) {
|
||||
if (view.is_empty())
|
||||
return Vector<RegexStringView> { view };
|
||||
|
||||
Vector<RegexStringView> views;
|
||||
auto it = view.begin();
|
||||
auto previous_newline_position_it = it;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue