buffer: fast-case for empty string in byteLength
authorJackson Tian <puling.tyq@alibaba-inc.com>
Thu, 16 Apr 2015 15:31:34 +0000 (23:31 +0800)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Thu, 16 Apr 2015 22:26:48 +0000 (18:26 -0400)
commit431673ebd1aaa30424921a7ef2fcb18c81b146eb
treebfba4b1afe1757fae20b3435483264958f1029b9
parent62f5f4cec942864d1cd21ef31bf650ddca874093
buffer: fast-case for empty string in byteLength

When the string is empty, calling the binding is unnecessary and slow.

PR-URL: https://github.com/iojs/io.js/pull/1441
Reviewed-by: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Christian Tellnes <christian@tellnes.no>
lib/buffer.js