Skip to content

Commit f5b7e18

Browse files
committed
src: remove unused code
PR-URL: #1042 Reviewed-By: Trevor Norris <[email protected]>
1 parent 4ae64b2 commit f5b7e18

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/string_bytes.cc

+3-7
Original file line numberDiff line numberDiff line change
@@ -754,21 +754,17 @@ Local<Value> StringBytes::Encode(Isolate* isolate,
754754
Local<Value> StringBytes::Encode(Isolate* isolate,
755755
const uint16_t* buf,
756756
size_t buflen) {
757-
const uint16_t* src = buf;
758-
759757
Local<String> val;
758+
760759
if (buflen < EXTERN_APEX) {
761760
val = String::NewFromTwoByte(isolate,
762-
src,
761+
buf,
763762
String::kNormalString,
764763
buflen);
765764
} else {
766-
val = ExternTwoByteString::NewFromCopy(isolate, src, buflen);
765+
val = ExternTwoByteString::NewFromCopy(isolate, buf, buflen);
767766
}
768767

769-
if (src != buf)
770-
delete[] src;
771-
772768
return val;
773769
}
774770

0 commit comments

Comments
 (0)