Commit 4ddd6406 authored by Ben Noordhuis's avatar Ben Noordhuis
Browse files

lib: avoid .toLowerCase() call in Buffer#write()

Avoid a costly String#toLowerCase() call in Buffer#write() in the
common case, i.e., that the string is already lowercase.  Reduces
the running time of the following benchmark by about 40%:

    for (var b = Buffer(1), i = 0; i < 25e6; ++i) b.write('x', 'ucs2');

PR-URL: https://github.com/iojs/io.js/pull/1048


Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
parent bbf54a55
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment