mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
buffer: avoid creating unnecessary environment
PR-URL: https://github.com/nodejs/node/pull/58053 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
1 parent
66f2c605a8
commit
e7e8256d35
1 file changed
+2
-2
+2
-2
@@ -736,11 +736,11 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
|
||||
}
|
||||
|
||||
void SlowByteLengthUtf8(const FunctionCallbackInfo<Value>& args) {
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
CHECK(args[0]->IsString());
|
||||
|
||||
// Fast case: avoid StringBytes on UTF8 string. Jump to v8.
|
||||
args.GetReturnValue().Set(args[0].As<String>()->Utf8Length(env->isolate()));
|
||||
args.GetReturnValue().Set(
|
||||
args[0].As<String>()->Utf8Length(args.GetIsolate()));
|
||||
}
|
||||
|
||||
uint32_t FastByteLengthUtf8(Local<Value> receiver,
|
||||
|
||||
Reference in new issue
Block a user