File tree 1 file changed +2
-6
lines changed
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -355,11 +355,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle<Value> val) {
355
355
break ;
356
356
357
357
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 ) {
363
359
// A single UCS2 codepoint never takes up more than 3 utf8 bytes.
364
360
// Unless the string is really long we just allocate so much space that
365
361
// we're certain the string fits in there entirely.
@@ -368,7 +364,7 @@ size_t StreamWrap::GetStringSizeImpl(Handle<Value> val) {
368
364
} else {
369
365
// The string is really long. Compute the allocation size that we
370
366
// actually need.
371
- return string->Utf8Length ();
367
+ return string->Utf8Length ();
372
368
}
373
369
break ;
374
370
You can’t perform that action at this time.
0 commit comments