Skip to content

Commit ca86c93

Browse files
anonrigRafaelGSS
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 dc22890 commit ca86c93

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
@@ -721,11 +721,11 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) {
721721
}
722722

723723
void SlowByteLengthUtf8(const FunctionCallbackInfo<Value>& args) {
724-
Environment* env = Environment::GetCurrent(args);
725724
CHECK(args[0]->IsString());
726725

727726
// Fast case: avoid StringBytes on UTF8 string. Jump to v8.
728-
args.GetReturnValue().Set(args[0].As<String>()->Utf8Length(env->isolate()));
727+
args.GetReturnValue().Set(
728+
args[0].As<String>()->Utf8Length(args.GetIsolate()));
729729
}
730730

731731
uint32_t FastByteLengthUtf8(

0 commit comments

Comments
 (0)