node icon indicating copy to clipboard operation
node copied to clipboard

src: avoid copy by using std::views::keys

Open anonrig opened this issue 1 year ago • 4 comments

We can leverage C++20 and use std::views::keys() which returns std::ranges::elements_view<T, S> which avoids creating a vector for GetBuiltinIds()

anonrig avatar Nov 29 '24 17:11 anonrig

Review requested:

  • [ ] @nodejs/startup

nodejs-github-bot avatar Nov 29 '24 17:11 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/63784/

nodejs-github-bot avatar Nov 29 '24 17:11 nodejs-github-bot

Codecov Report

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

Project coverage is 88.00%. Comparing base (4efb7ae) to head (5d6ffea). Report is 475 commits behind head on main.

Files with missing lines Patch % Lines
src/util-inl.h 76.92% 1 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56080      +/-   ##
==========================================
+ Coverage   87.99%   88.00%   +0.01%     
==========================================
  Files         656      656              
  Lines      188988   188994       +6     
  Branches    35988    35989       +1     
==========================================
+ Hits       166302   166328      +26     
+ Misses      15848    15838      -10     
+ Partials     6838     6828      -10     
Files with missing lines Coverage Δ
src/node_builtins.cc 78.20% <100.00%> (-0.47%) :arrow_down:
src/node_builtins.h 100.00% <100.00%> (ø)
src/util.h 91.22% <ø> (ø)
src/util-inl.h 83.89% <76.92%> (+0.03%) :arrow_up:

... and 23 files with indirect coverage changes

codecov[bot] avatar Nov 29 '24 18:11 codecov[bot]

cc @nodejs/build this is blocked by the macOS infra.

14:01:20 ../src/util.h:45:10: fatal error: 'ranges' file not found
14:01:20 #include <ranges>

anonrig avatar Nov 29 '24 20:11 anonrig

CI: https://ci.nodejs.org/job/node-test-pull-request/64611/

nodejs-github-bot avatar Jan 22 '25 19:01 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/64845/

nodejs-github-bot avatar Jan 30 '25 15:01 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/64861/

nodejs-github-bot avatar Jan 31 '25 01:01 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/64874/

nodejs-github-bot avatar Jan 31 '25 13:01 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/64887/

nodejs-github-bot avatar Jan 31 '25 21:01 nodejs-github-bot

Landed in d54641cd3883b3be116ea24e7b64744331f265a4

nodejs-github-bot avatar Feb 06 '25 16:02 nodejs-github-bot