Skip to content

buffer: add end parameter#62390

Merged
nodejs-github-bot merged 1 commit intomainfrom
buffer-index-of-end
Apr 11, 2026
Merged

buffer: add end parameter#62390
nodejs-github-bot merged 1 commit intomainfrom
buffer-index-of-end

Conversation

@ronag
Copy link
Copy Markdown
Member

@ronag ronag commented Mar 22, 2026

To limit how far into the buffer we search without allocating an unnecessary subarray.

@ronag ronag requested review from jasnell and mcollina March 22, 2026 09:54
@ronag ronag self-assigned this Mar 22, 2026
@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++. needs-ci PRs that need a full CI run. labels Mar 22, 2026
@ronag ronag force-pushed the buffer-index-of-end branch 2 times, most recently from 6dc1d1e to f622fff Compare March 22, 2026 09:55
ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from f622fff to b57fa1f Compare March 22, 2026 09:58
ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from b57fa1f to b739413 Compare March 22, 2026 10:08
@ronag ronag marked this pull request as ready for review March 22, 2026 10:08
ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from b739413 to 5690750 Compare March 22, 2026 10:39
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
Copy link
Copy Markdown
Member

CI does not seem happy

ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from 5690750 to ddbc9cd Compare March 22, 2026 13:36
@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Mar 22, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 86.13861% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.80%. Comparing base (bf1aebc) to head (fd6b746).
⚠️ Report is 64 commits behind head on main.

Files with missing lines Patch % Lines
src/node_buffer.cc 70.83% 4 Missing and 10 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62390      +/-   ##
==========================================
+ Coverage   89.72%   89.80%   +0.08%     
==========================================
  Files         695      699       +4     
  Lines      214464   216422    +1958     
  Branches    41067    41384     +317     
==========================================
+ Hits       192420   194360    +1940     
- Misses      14106    14146      +40     
+ Partials     7938     7916      -22     
Files with missing lines Coverage Δ
lib/buffer.js 99.18% <100.00%> (+0.01%) ⬆️
src/node_buffer.cc 68.03% <70.83%> (-0.17%) ⬇️

... and 82 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ronag ronag requested a review from mcollina March 22, 2026 16:00
```

### `buf.includes(value[, byteOffset][, encoding])`
### `buf.includes(value[, byteOffset[, end]][, encoding])`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we start getting into new optional arguments in the middle like this I think we should consider an alternative signature with an options bag instead...

buf.includes(value, {
  byteOffset: 0,
  end: 10,
  encoding: 'utf8',
});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow up PR?

@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - buffer: add end parameter
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/23542726197

@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented Apr 2, 2026

There's a conflict to solve

ronag added a commit that referenced this pull request Apr 4, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from ddbc9cd to c4aecb4 Compare April 4, 2026 18:07
@nodejs-github-bot nodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Apr 9, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/62390
✔  Done loading data for nodejs/node/pull/62390
----------------------------------- PR info ------------------------------------
Title      buffer: add end parameter (#62390)
Author     Robert Nagy <ronagy@icloud.com> (@ronag)
Branch     ronag:buffer-index-of-end -> nodejs:main
Labels     buffer, c++, semver-minor, author ready, needs-ci, review wanted
Commits    1
 - buffer: add end parameter
Committers 1
 - Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 22 Mar 2026 09:53:58 GMT
   ✔  Approvals: 1
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/62390#pullrequestreview-4067847074
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-04-08T05:43:34Z: https://ci.nodejs.org/job/node-test-pull-request/72552/
- Querying data for job/node-test-pull-request/72552/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 62390
From https://github.com/nodejs/node
 * branch                  refs/pull/62390/merge -> FETCH_HEAD
✔  Fetched commits as 70c1d6b7314f..445df3f2a63a
--------------------------------------------------------------------------------
[main c26888b5a4] buffer: add end parameter
 Author: Robert Nagy <ronagy@icloud.com>
 Date: Sun Mar 22 10:53:00 2026 +0100
 5 files changed, 195 insertions(+), 58 deletions(-)
   ✔  Patches applied
--------------------------------------------------------------------------------
   ⚠  Found PR-URL: https://github.com/nodejs/node/pull/62390, skipping..
--------------------------------- New Message ----------------------------------
buffer: add end parameter

To limit how far into the buffer we search without allocating an
unnecessary subarray.

Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

[main 3fb6848c29] buffer: add end parameter
Author: Robert Nagy <ronagy@icloud.com>
Date: Sun Mar 22 10:53:00 2026 +0100
5 files changed, 195 insertions(+), 58 deletions(-)
✖ 3fb6848c294c6f3d05c60720e0fbe3ac0cf11cd1
✔ 0:0 no Co-authored-by metadata co-authored-by-is-trailer
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 metadata is at end of message metadata-end
✖ 0:0 Commit must have a PR-URL. pr-url
✔ 0:0 reviewers are valid reviewers
✔ 0:0 valid subsystems subsystem
✔ 0:0 Title is formatted correctly. title-format
✔ 0:0 Title is <= 50 columns. title-length

ℹ Please fix the commit message and try again.
Please manually ammend the commit message, by running
git commit --amend
Once commit message is fixed, finish the landing command running
git node land --continue

https://github.com/nodejs/node/actions/runs/24207909791

@ronag ronag removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Apr 10, 2026
ronag added a commit that referenced this pull request Apr 10, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
Signed-off-by: Robert Nagy <ronay@icloud.com>
@ronag ronag force-pushed the buffer-index-of-end branch from 445df3f to 999b453 Compare April 10, 2026 07:45
@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@ronag ronag added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 11, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 11, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/62390
✔  Done loading data for nodejs/node/pull/62390
----------------------------------- PR info ------------------------------------
Title      buffer: add end parameter (#62390)
Author     Robert Nagy <ronagy@icloud.com> (@ronag)
Branch     ronag:buffer-index-of-end -> nodejs:main
Labels     buffer, c++, semver-minor, author ready, needs-ci, review wanted
Commits    1
 - buffer: add end parameter
Committers 1
 - Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 22 Mar 2026 09:53:58 GMT
   ✔  Approvals: 2
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/62390#pullrequestreview-4067847074
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/62390#pullrequestreview-4092335147
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-04-11T08:36:32Z: https://ci.nodejs.org/job/node-test-pull-request/72624/
- Querying data for job/node-test-pull-request/72624/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
   726b22048a..ef8f8f886c  main       -> origin/main
✔  origin/main is now up-to-date
main is out of sync with origin/main. Mismatched commits:
 - c8c00cba5e sqlite: use OneByte for ASCII text and internalize col names
 - ef8f8f886c sqlite: use OneByte for ASCII text and internalize col names
--------------------------------------------------------------------------------
HEAD is now at ef8f8f886c sqlite: use OneByte for ASCII text and internalize col names
   ✔  Reset to origin/main
- Downloading patch for 62390
From https://github.com/nodejs/node
 * branch                  refs/pull/62390/merge -> FETCH_HEAD
✔  Fetched commits as ef8f8f886c88..999b4533429e
--------------------------------------------------------------------------------
[main a1bc4270d1] buffer: add end parameter
 Author: Robert Nagy <ronagy@icloud.com>
 Date: Sun Mar 22 10:53:00 2026 +0100
 5 files changed, 195 insertions(+), 58 deletions(-)
   ✔  Patches applied
--------------------------------------------------------------------------------
   ⚠  Found PR-URL: https://github.com/nodejs/node/pull/62390, skipping..
--------------------------------- New Message ----------------------------------
buffer: add end parameter

To limit how far into the buffer we search without allocating an
unnecessary subarray.

Signed-off-by: Robert Nagy <ronay@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[main 3b3ab1b8a1] buffer: add end parameter
Author: Robert Nagy <ronagy@icloud.com>
Date: Sun Mar 22 10:53:00 2026 +0100
5 files changed, 195 insertions(+), 58 deletions(-)
✖ 3b3ab1b8a159193daa435ab9dfe8265aab00d72a
✔ 0:0 no Co-authored-by metadata co-authored-by-is-trailer
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 metadata is at end of message metadata-end
✖ 0:0 Commit must have a PR-URL. pr-url
✔ 0:0 reviewers are valid reviewers
✔ 0:0 valid subsystems subsystem
✔ 0:0 Title is formatted correctly. title-format
✔ 0:0 Title is <= 50 columns. title-length

ℹ Please fix the commit message and try again.
Please manually ammend the commit message, by running
git commit --amend
Once commit message is fixed, finish the landing command running
git node land --continue

https://github.com/nodejs/node/actions/runs/24280643630

To limit how far into the buffer we search without allocating an
unnecessary subarray.

Signed-off-by: Robert Nagy <ronay@icloud.com>
@ronag ronag force-pushed the buffer-index-of-end branch from 999b453 to fd6b746 Compare April 11, 2026 14:59
@ronag ronag added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 11, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 11, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/62390
✔  Done loading data for nodejs/node/pull/62390
----------------------------------- PR info ------------------------------------
Title      buffer: add end parameter (#62390)
Author     Robert Nagy <ronagy@icloud.com> (@ronag)
Branch     ronag:buffer-index-of-end -> nodejs:main
Labels     buffer, c++, semver-minor, author ready, needs-ci, review wanted
Commits    1
 - buffer: add end parameter
Committers 1
 - Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 22 Mar 2026 09:53:58 GMT
   ✔  Approvals: 2
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/62390#pullrequestreview-4067847074
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/62390#pullrequestreview-4092335147
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-04-11T10:37:41Z: https://ci.nodejs.org/job/node-test-pull-request/72624/
   ⚠  Commits were pushed after the last Full PR CI run:
   ⚠  - buffer: add end parameter
- Querying data for job/node-test-pull-request/72624/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/24286987028

@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 11, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@ronag ronag added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 11, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 11, 2026
@nodejs-github-bot nodejs-github-bot merged commit f2fda60 into main Apr 11, 2026
75 checks passed
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in f2fda60

@nodejs-github-bot nodejs-github-bot deleted the buffer-index-of-end branch April 11, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. review wanted PRs that need reviews. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants