mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:38:13 +00:00
AK: Accept StringView in LexicalPath::join
The first argument for LexicalPath::join was a String const&, which resulted in an unnecessary memory copy when invoked with a StringView. Changing the type of the parameter to StringView avoids the extra cost. This was noticed while working on #10230.
This commit is contained in:
parent
0af0ee4293
commit
69b64a6b04
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ public:
|
|||
[[nodiscard]] static String relative_path(StringView const& absolute_path, StringView const& prefix);
|
||||
|
||||
template<typename... S>
|
||||
[[nodiscard]] static LexicalPath join(String const& first, S&&... rest)
|
||||
[[nodiscard]] static LexicalPath join(StringView first, S&&... rest)
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append(first);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue