Skip to content

Commit 2c46f16

Browse files
committed
to stringview without copy
1 parent 31093a4 commit 2c46f16

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/binding.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,9 +1625,7 @@ void v8_inspector__Session__DELETE(v8_inspector::V8InspectorSession* self) {
16251625
void v8_inspector__Session__dispatchProtocolMessage(
16261626
v8_inspector::V8InspectorSession *session, v8::Isolate *isolate,
16271627
const char *msg, int msg_len) {
1628-
std::string message; // NOTE Sjors: This looks like an unnecessary copy
1629-
message.assign(msg, msg_len);
1630-
auto str_view = toStringView(message);
1628+
auto str_view = toStringView(msg, msg_len);
16311629
session->dispatchProtocolMessage(str_view);
16321630
}
16331631

0 commit comments

Comments
 (0)