From f5b7e18243b25a39ec53890344f9353a1b54d6cd Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 3 Mar 2015 01:37:59 +0100 Subject: [PATCH] src: remove unused code PR-URL: https://github.com/iojs/io.js/pull/1042 Reviewed-By: Trevor Norris --- src/string_bytes.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 1df6879a6a0346..7b07c6b7da10b4 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -754,21 +754,17 @@ Local StringBytes::Encode(Isolate* isolate, Local StringBytes::Encode(Isolate* isolate, const uint16_t* buf, size_t buflen) { - const uint16_t* src = buf; - Local val; + if (buflen < EXTERN_APEX) { val = String::NewFromTwoByte(isolate, - src, + buf, String::kNormalString, buflen); } else { - val = ExternTwoByteString::NewFromCopy(isolate, src, buflen); + val = ExternTwoByteString::NewFromCopy(isolate, buf, buflen); } - if (src != buf) - delete[] src; - return val; }