Skip to content

Commit 7349667

Browse files
committed
stream_wrap: MayContainNonAscii() is deprecated
V8 3.19.0 deprecates v8::String::MayContainNonAscii(). It always returns true so there is not much point in keeping the call site around.
1 parent 0c405cf commit 7349667

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/stream_wrap.cc

+2-6
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle<Value> val) {
355355
break;
356356

357357
case kUtf8:
358-
if (!(string->MayContainNonAscii())) {
359-
// If the string has only ascii characters, we know exactly how big
360-
// the storage should be.
361-
return string->Length();
362-
} else if (string->Length() < 65536) {
358+
if (string->Length() < 65536) {
363359
// A single UCS2 codepoint never takes up more than 3 utf8 bytes.
364360
// Unless the string is really long we just allocate so much space that
365361
// we're certain the string fits in there entirely.
@@ -368,7 +364,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle<Value> val) {
368364
} else {
369365
// The string is really long. Compute the allocation size that we
370366
// actually need.
371-
return string->Utf8Length();
367+
return string->Utf8Length();
372368
}
373369
break;
374370

0 commit comments

Comments
 (0)