buffer: default to UTF8 in byteLength() · nodejs/node@ab5b529 · GitHub
Skip to content

Commit ab5b529

Browse files
tomgcorvagg
authored andcommitted
buffer: default to UTF8 in byteLength()
If an undefined encoding is passed to byteLength(), assume that it is UTF8 immediately. This yields a small speedup, as it prevents string operations on the encoding argument. PR-URL: #4010 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
1 parent ed255ab commit ab5b529

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/buffer.js

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)