From: Ben Noordhuis Date: Tue, 3 Mar 2015 00:37:59 +0000 (+0100) Subject: src: remove unused code X-Git-Tag: v1.5.0~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5b7e18243b25a39ec53890344f9353a1b54d6cd;p=platform%2Fupstream%2Fnodejs.git src: remove unused code PR-URL: https://github.com/iojs/io.js/pull/1042 Reviewed-By: Trevor Norris --- diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 1df6879..7b07c6b 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; }