From 7349667467f5acf9897513236b6bfba0111a53cf Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 13 May 2013 04:28:59 +0200 Subject: [PATCH] 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. --- src/stream_wrap.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 04b08814ce..ba79fa7f3c 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -355,11 +355,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle val) { break; case kUtf8: - if (!(string->MayContainNonAscii())) { - // If the string has only ascii characters, we know exactly how big - // the storage should be. - return string->Length(); - } else if (string->Length() < 65536) { + if (string->Length() < 65536) { // A single UCS2 codepoint never takes up more than 3 utf8 bytes. // Unless the string is really long we just allocate so much space that // we're certain the string fits in there entirely. @@ -368,7 +364,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle val) { } else { // The string is really long. Compute the allocation size that we // actually need. - return string->Utf8Length(); + return string->Utf8Length(); } break;