Skip to content

Commit

Permalink
src: use string_view instead of std::string&
Browse files Browse the repository at this point in the history
PR-URL: #46471
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
anonrig authored and MylesBorins committed Feb 18, 2023
1 parent f35f6d2 commit 60c2a86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/inspector/main_thread_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Deletable* MainThreadInterface::GetObjectIfExists(int id) {
return iterator->second.get();
}

std::unique_ptr<StringBuffer> Utf8ToStringView(const std::string& message) {
std::unique_ptr<StringBuffer> Utf8ToStringView(const std::string_view message) {
size_t expected_u16_length =
simdutf::utf16_length_from_utf8(message.data(), message.length());
MaybeStackBuffer<char16_t> buffer(expected_u16_length);
Expand Down
2 changes: 1 addition & 1 deletion src/inspector/main_thread_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Deletable {
};

std::unique_ptr<v8_inspector::StringBuffer> Utf8ToStringView(
const std::string& message);
const std::string_view message);

using MessageQueue = std::deque<std::unique_ptr<Request>>;

Expand Down

0 comments on commit 60c2a86

Please sign in to comment.