From fe27901d313da71f78db4498bbd28ab144b45393 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:56:23 -0500 Subject: [PATCH] perf: use v8::String::NewFromUtf8Literal in ToV8() gin converter (#44517) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- shell/common/gin_converters/std_converter.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/shell/common/gin_converters/std_converter.h b/shell/common/gin_converters/std_converter.h index eb6d4c18742e..de499cf46715 100644 --- a/shell/common/gin_converters/std_converter.h +++ b/shell/common/gin_converters/std_converter.h @@ -70,12 +70,10 @@ struct Converter { } }; -template -struct Converter { - static v8::Local ToV8(v8::Isolate* isolate, const char* val) { - return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal, - n - 1) - .ToLocalChecked(); +template +struct Converter { + static v8::Local ToV8(v8::Isolate* isolate, const char (&val)[N]) { + return v8::String::NewFromUtf8Literal(isolate, val); } };