We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ae64b2 commit f5b7e18Copy full SHA for f5b7e18
src/string_bytes.cc
@@ -754,21 +754,17 @@ Local<Value> StringBytes::Encode(Isolate* isolate,
754
Local<Value> StringBytes::Encode(Isolate* isolate,
755
const uint16_t* buf,
756
size_t buflen) {
757
- const uint16_t* src = buf;
758
-
759
Local<String> val;
+
760
if (buflen < EXTERN_APEX) {
761
val = String::NewFromTwoByte(isolate,
762
- src,
+ buf,
763
String::kNormalString,
764
buflen);
765
} else {
766
- val = ExternTwoByteString::NewFromCopy(isolate, src, buflen);
+ val = ExternTwoByteString::NewFromCopy(isolate, buf, buflen);
767
}
768
769
- if (src != buf)
770
- delete[] src;
771
772
return val;
773
774
0 commit comments