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
Notes: sideshowbarker 2024-07-17 08:34:29 +09:00
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) {

View file

@ -9,5 +9,5 @@
#include <AK/DeprecatedString.h>
namespace Diff {
DeprecatedString generate_only_additions(DeprecatedString const&);
DeprecatedString generate_only_additions(StringView);
};