Skip to content

buffer: always let indexOf look at odd indexes - #26594

Closed
seishun wants to merge 1 commit into
nodejs:masterfrom
seishun:indexof
Closed

buffer: always let indexOf look at odd indexes#26594
seishun wants to merge 1 commit into
nodejs:masterfrom
seishun:indexof

Conversation

@seishun

@seishun seishun commented Mar 11, 2019

Copy link
Copy Markdown
Contributor

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: #26448

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

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: #26448
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. labels Mar 11, 2019
@BridgeAR BridgeAR added the semver-major PRs that contain breaking changes and should be released in the next major version. label Mar 27, 2019
@targos

targos commented Mar 30, 2019

Copy link
Copy Markdown
Member

@nodejs/buffer

@fhinkel

fhinkel commented Oct 28, 2019

Copy link
Copy Markdown
Member

I'm cleaning out a few old PRs 🧹. I'm closing this due to inactivity. Please re-open if needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buffer.indexOf is incorrect in utf16le encoding for odd byteOffset

6 participants