Skip to content

Commit f89b36e

Browse files
anonrigaduh95
authored andcommitted
buffer: avoid creating unnecessary environment
PR-URL: #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>
1 parent 88ec7c8 commit f89b36e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_buffer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,11 +736,11 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
736736
}
737737

738738
void SlowByteLengthUtf8(const FunctionCallbackInfo<Value>& args) {
739-
Environment* env = Environment::GetCurrent(args);
740739
CHECK(args[0]->IsString());
741740

742741
// Fast case: avoid StringBytes on UTF8 string. Jump to v8.
743-
args.GetReturnValue().Set(args[0].As<String>()->Utf8Length(env->isolate()));
742+
args.GetReturnValue().Set(
743+
args[0].As<String>()->Utf8Length(args.GetIsolate()));
744744
}
745745

746746
uint32_t FastByteLengthUtf8(Local<Value> receiver,

0 commit comments

Comments
 (0)