Skip to content
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

src: minor cleanups on OneByteString usage #56482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Jan 5, 2025

  • Provide a OneByteString variant that accepts std::string_view
  • Use FIXED_ONE_BYTE_STRING in appropriate places

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http2
  • @nodejs/net
  • @nodejs/startup

@jasnell jasnell requested a review from anonrig January 5, 2025 20:39
@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 Jan 5, 2025
@jasnell jasnell requested a review from lpinca January 5, 2025 20:39
src/util-inl.h Outdated Show resolved Hide resolved
src/util.h Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 5, 2025

Codecov Report

Attention: Patch coverage is 98.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.12%. Comparing base (7c3aa9f) to head (1dca50e).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/node_http2.cc 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56482      +/-   ##
==========================================
- Coverage   89.12%   89.12%   -0.01%     
==========================================
  Files         662      662              
  Lines      191556   191569      +13     
  Branches    36860    36863       +3     
==========================================
+ Hits       170732   170740       +8     
- Misses      13690    13691       +1     
- Partials     7134     7138       +4     
Files with missing lines Coverage Δ
src/crypto/crypto_ec.cc 67.06% <100.00%> (-0.34%) ⬇️
src/crypto/crypto_hash.cc 65.57% <100.00%> (ø)
src/crypto/crypto_tls.cc 78.43% <100.00%> (-0.02%) ⬇️
src/histogram.cc 73.52% <100.00%> (ø)
src/inspector_js_api.cc 86.29% <100.00%> (ø)
src/node_builtins.cc 78.53% <100.00%> (ø)
src/node_constants.cc 97.17% <100.00%> (+0.11%) ⬆️
src/node_errors.h 85.00% <ø> (ø)
src/node_messaging.cc 83.93% <100.00%> (ø)
src/node_perf.h 68.08% <100.00%> (+0.69%) ⬆️
... and 8 more

... and 18 files with indirect coverage changes

@jasnell jasnell force-pushed the jasnell/onebytestring-cleanups branch from cfda580 to f8bd2d1 Compare January 6, 2025 16:05
@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 6, 2025
@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell removed the needs-ci PRs that need a full CI run. label Jan 6, 2025
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

LGTM but agreeing with @anonrig's comments about treating std::string_view like a primitive here, not something that should need to be passed as a reference

* Provide a OneByteString variant that accepts std::string_view
* Use FIXED_ONE_BYTE_STRING in appropriate places

Signed-off-by: James M Snell <[email protected]>
@jasnell jasnell force-pushed the jasnell/onebytestring-cleanups branch from f8bd2d1 to 1dca50e Compare January 7, 2025 18:13
@nodejs-github-bot
Copy link
Collaborator

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++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants