mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +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
Notes:
sideshowbarker
2024-07-18 03:22:23 +09:00
Author: https://github.com/rtobar
Commit: 69b64a6b04
Pull-request: https://github.com/SerenityOS/serenity/pull/10237
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