Skip to content

src: remove useless dereferencing in THROW_... - #60054

Closed
addaleax wants to merge 1 commit into
nodejs:mainfrom
addaleax:no-throw-dereference
Closed

src: remove useless dereferencing in THROW_...#60054
addaleax wants to merge 1 commit into
nodejs:mainfrom
addaleax:no-throw-dereference

Conversation

@addaleax

Copy link
Copy Markdown
Member

Our THROW_... helpers can handle strings or string views just fine, all this does is add an extra strlen() call that can and should be avoided.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/sqlite

@nodejs-github-botnodejs-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 Sep 28, 2025
Our `THROW_...` helpers can handle strings or string views just fine,
all this does is add an extra `strlen()` call that can and should
be avoided.
@codecov

codecovBot commented Sep 28, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.46%. Comparing base (c6316f9) to head (027d4d1).
⚠️ Report is 9 commits behind head on main.

Files with missing linesPatch %Lines
src/quic/tlscontext.cc0.00%2 Missing ⚠️
src/crypto/crypto_hash.cc0.00%1 Missing ⚠️
src/crypto/crypto_hmac.cc0.00%1 Missing ⚠️
src/crypto/crypto_rsa.cc66.66%1 Missing ⚠️
src/node_binding.cc75.00%1 Missing ⚠️
src/node_process_methods.cc0.00%1 Missing ⚠️
src/quic/defs.h80.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #60054 +/- ##
==========================================
+ Coverage 88.45% 88.46% +0.01% 
==========================================
Files 703 703 Lines 207546 207543 -3 Branches 40011 40007 -4 ==========================================
+ Hits 183591 183612 +21 + Misses 15949 15932 -17 + Partials 8006 7999 -7 
Files with missing linesCoverage Δ
src/crypto/crypto_context.cc68.77% <100.00%> (ø)
src/crypto/crypto_hkdf.cc65.27% <100.00%> (ø)
src/crypto/crypto_pbkdf2.cc68.11% <100.00%> (ø)
src/crypto/crypto_sig.cc70.62% <100.00%> (-0.41%)⬇️
src/node_report.cc93.15% <ø> (-0.02%)⬇️
src/node_sqlite.cc79.56% <100.00%> (ø)
src/quic/endpoint.cc56.42% <100.00%> (-0.05%)⬇️
src/crypto/crypto_hash.cc76.94% <0.00%> (+0.29%)⬆️
src/crypto/crypto_hmac.cc68.23% <0.00%> (ø)
src/crypto/crypto_rsa.cc63.81% <66.66%> (-0.12%)⬇️
... and 4 more

... and 31 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.

@addaleaxaddaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Sep 28, 2025
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@geeksilva97geeksilva97 added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 28, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

addaleax added a commit that referenced this pull request Sep 30, 2025
Our `THROW_...` helpers can handle strings or string views just fine,
all this does is add an extra `strlen()` call that can and should
be avoided.
PR-URL: #60054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in e4e859e

targos pushed a commit that referenced this pull request Oct 6, 2025
Our `THROW_...` helpers can handle strings or string views just fine,
all this does is add an extra `strlen()` call that can and should
be avoided.
PR-URL: #60054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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++.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@addaleax@nodejs-github-bot@jasnell@lpinca@geeksilva97