mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibDiff: Make Diff::generate_only_additions take text as StringView
This commit is contained in:
parent
ce2ed7615a
commit
697d6ffb1d
2 changed files with 3 additions and 3 deletions
|
@ -10,9 +10,9 @@
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
|
|
||||||
namespace Diff {
|
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;
|
StringBuilder builder;
|
||||||
builder.appendff("@@ -0,0 +1,{} @@\n", lines.size());
|
builder.appendff("@@ -0,0 +1,{} @@\n", lines.size());
|
||||||
for (auto const& line : lines) {
|
for (auto const& line : lines) {
|
||||||
|
|
|
@ -9,5 +9,5 @@
|
||||||
#include <AK/DeprecatedString.h>
|
#include <AK/DeprecatedString.h>
|
||||||
|
|
||||||
namespace Diff {
|
namespace Diff {
|
||||||
DeprecatedString generate_only_additions(DeprecatedString const&);
|
DeprecatedString generate_only_additions(StringView);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue