Skip to content

buffer: always let indexOf look at odd indexes

Rodrigo Muino Tomonari requested to merge github/fork/seishun/indexof into master

Previously, buffer.indexOf would look only at even indexes when the encoding is UTF-16. This behavior is undocumented and unintuitive.

Detemplatize string_search.h because it is now used with only one type.

Fixes: https://github.com/nodejs/node/issues/26448

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading