Skip to content

Commit

Permalink
src: use string_view instead of std::string&
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Feb 2, 2023
1 parent 1fa053c commit 3712861
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
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());
char16_t buffer[expected_u16_length];
Expand Down
2 changes: 1 addition & 1 deletion src/inspector/main_thread_interface.h
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 3712861

Please sign in to comment.