mirror of https://github.com/lukechilds/node.git
Browse Source
Fix the fast path for `buffer.fill()` with a single-character string. The fast path only works for strings that are equivalent to a single-byte buffer, but that condition was not checked properly for the `utf8` or `utf16le` encodings and is always true for the `latin1` encoding. This change fixes these problems. Fixes: https://github.com/nodejs/node/issues/9836 PR-URL: https://github.com/nodejs/node/pull/9837 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>v6
Anna Henningsen
8 years ago
2 changed files with 42 additions and 12 deletions
Loading…
Reference in new issue