perf: use v8::String::NewFromUtf8Literal in ToV8() gin converter (#44501)
This commit is contained in:
parent
2081f771e4
commit
b985d8eb28
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…
Add table
Reference in a new issue