1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

LibDiff: Make Diff::generate_only_additions take text as StringView

This commit is contained in:
Karol Kosek 2022-12-18 19:52:25 +01:00 committed by Andreas Kling
parent ce2ed7615a
commit 697d6ffb1d
2 changed files with 3 additions and 3 deletions

View file

@ -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) {