mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
AK: Replace the boolean parameter of StringView::lines with a named enum
This commit is contained in:
parent
d9349f1510
commit
07a27b2ec0
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/trflynn89
Commit: 07a27b2ec0
Pull-request: https://github.com/SerenityOS/serenity/pull/23525
Reviewed-by: https://github.com/LucasChollet ✅
4 changed files with 9 additions and 5 deletions
|
@ -68,12 +68,12 @@ Vector<StringView> StringView::split_view(StringView separator, SplitBehavior sp
|
|||
return parts;
|
||||
}
|
||||
|
||||
Vector<StringView> StringView::lines(bool consider_cr) const
|
||||
Vector<StringView> StringView::lines(ConsiderCarriageReturn consider_carriage_return) const
|
||||
{
|
||||
if (is_empty())
|
||||
return {};
|
||||
|
||||
if (!consider_cr)
|
||||
if (consider_carriage_return == ConsiderCarriageReturn::No)
|
||||
return split_view('\n', SplitBehavior::KeepEmpty);
|
||||
|
||||
Vector<StringView> v;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue