mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +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
|
@ -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…
Reference in a new issue