buffer: use Utf8LengthV2() instead of Utf8Length() · nodejs/node@8b5ada4

Original file line numberDiff line numberDiff line change

@@ -742,7 +742,7 @@ uint32_t FastByteLengthUtf8(

742742

Local<String> sourceStr = sourceValue.As<String>();

743743
744744

if (!sourceStr->IsExternalOneByte()) {

745-

return sourceStr->Utf8Length(isolate);

745+

return sourceStr->Utf8LengthV2(isolate);

746746

}

747747

auto source = sourceStr->GetExternalOneByteStringResource();

748748

// For short inputs, the function call overhead to simdutf is maybe