Skip to content

src: use ranges library (C++20) more systematically #58028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lemire
Copy link
Member

@lemire lemire commented Apr 25, 2025

In PR #57975, I introduced C++20 ranges as an experiment. This current PR extends the application of ranges to simplify even more code.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/crypto
  • @nodejs/http2
  • @nodejs/net
  • @nodejs/single-executable
  • @nodejs/startup
@lemire lemire requested a review from anonrig April 25, 2025 18:49
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 25, 2025
@lemire lemire requested review from codebytere and jasnell April 25, 2025 18:49
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.27%. Comparing base (25fe802) to head (0a1606a).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/inspector_socket.cc 0.00% 0 Missing and 1 partial ⚠️
src/node.cc 85.71% 0 Missing and 1 partial ⚠️
src/node_credentials.cc 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #58028   +/-   ##
=======================================
  Coverage   90.27%   90.27%           
=======================================
  Files         630      630           
  Lines      186159   186147   -12     
  Branches    36473    36474    +1     
=======================================
- Hits       168053   168050    -3     
- Misses      10976    10977    +1     
+ Partials     7130     7120   -10     
Files with missing lines Coverage Δ
src/cleanup_queue.cc 85.00% <100.00%> (-0.72%) ⬇️
src/crypto/crypto_util.cc 72.26% <100.00%> (+0.25%) ⬆️
src/inspector_socket_server.cc 85.32% <100.00%> (ø)
src/node_dotenv.cc 84.53% <100.00%> (ø)
src/node_http2.h 91.61% <100.00%> (-0.05%) ⬇️
src/node_messaging.cc 82.62% <100.00%> (+0.13%) ⬆️
src/node_platform.cc 88.67% <100.00%> (-0.03%) ⬇️
src/node_process_object.cc 86.17% <100.00%> (-0.12%) ⬇️
src/node_report.cc 93.22% <100.00%> (-0.02%) ⬇️
src/node_sea.cc 91.28% <100.00%> (-0.03%) ⬇️
... and 5 more

... and 20 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.
@anonrig anonrig added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. request-ci Add this label to start a Jenkins CI on a PR. labels Apr 25, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 25, 2025
Copy link
Member

@vmoroz vmoroz left a comment

Choose a reason for hiding this comment

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

LGTM

@lemire lemire added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 26, 2025
@RafaelGSS RafaelGSS added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Apr 29, 2025
Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

LGTM. Added the dont-land labels to the release lines without C++20 support.

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. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
10 participants