mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 08:50:37 +00:00
LibDiff: Make Diff::generate_only_additions take text as StringView
This commit is contained in:
parent
ce2ed7615a
commit
697d6ffb1d
Notes:
sideshowbarker
2024-07-17 08:34:29 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/697d6ffb1d Pull-request: https://github.com/SerenityOS/serenity/pull/16576
2 changed files with 3 additions and 3 deletions
|
@ -10,9 +10,9 @@
|
|||
#include <AK/Vector.h>
|
||||
|
||||
namespace Diff {
|
||||
DeprecatedString generate_only_additions(DeprecatedString const& text)
|
||||
DeprecatedString generate_only_additions(StringView text)
|
||||
{
|
||||
auto lines = text.split('\n', SplitBehavior::KeepEmpty);
|
||||
auto lines = text.split_view('\n', SplitBehavior::KeepEmpty);
|
||||
StringBuilder builder;
|
||||
builder.appendff("@@ -0,0 +1,{} @@\n", lines.size());
|
||||
for (auto const& line : lines) {
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
#include <AK/DeprecatedString.h>
|
||||
|
||||
namespace Diff {
|
||||
DeprecatedString generate_only_additions(DeprecatedString const&);
|
||||
DeprecatedString generate_only_additions(StringView);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue