mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 01:55:07 +00:00
LibDiff: Make Diff::generate_only_additions take text as StringView
This commit is contained in:
parent
ce2ed7615a
commit
697d6ffb1d
|
@ -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