0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

2 Commits

Author SHA1 Message Date
Ben Noordhuis
e325ace53c buffer: speed up ascii character scanning
Speed up ASCII character scanning and conversion by 25% to 30% by scanning and
converting whole words instead of individual bytes.
2013-03-08 14:42:15 -08:00
Ben Noordhuis
96a314b68b buffer: strip high bits when converting to ascii
Consider the following example:

  console.log(Buffer('ú').toString('ascii'));

Before this commit, the contents of the buffer was used as-is and hence it
prints 'ú'.

Now, it prints 'C:'. Perhaps not much of an improvement but it conforms to what
the documentation says it does: strip off the high bits.

Fixes #4371.
2013-03-08 14:42:15 -08:00