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 <charles@charleskerr.com>
This commit is contained in:
parent
5498eaa29d
commit
fe27901d31
1 changed files with 4 additions and 6 deletions
|
@ -70,12 +70,10 @@ struct Converter<char[]> {
|
|||
}
|
||||
};
|
||||
|
||||
template <size_t n>
|
||||
struct Converter<char[n]> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const char* val) {
|
||||
return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal,
|
||||
n - 1)
|
||||
.ToLocalChecked();
|
||||
template <size_t N>
|
||||
struct Converter<char[N]> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const char (&val)[N]) {
|
||||
return v8::String::NewFromUtf8Literal(isolate, val);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue