buffer: use constexpr where possible#58141
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom May 6, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58141 +/- ##
=======================================
Coverage 90.17% 90.18%
=======================================
Files 630 630
Lines 186473 186473
Branches 36613 36615 +2
=======================================
+ Hits 168160 168166 +6
+ Misses 11128 11119 -9
- Partials 7185 7188 +3
🚀 New features to boost your workflow:
|
Member
|
Just for my education, does it really change the assembly emitted by compilers. This seems trivial to optimize but I don't know much about it 🙈 |
targos
approved these changes
May 3, 2025
Member
Author
Yes. The if statement that checks for these conditions will not be evaluated on runtime, but rather on compile time. Since this parameter is a template argument, we can make it a constexpr. |
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
RaisinTen
approved these changes
May 4, 2025
Collaborator
ronag
approved these changes
May 4, 2025
Collaborator
Collaborator
Collaborator
|
Landed in 2c36ffe |
targos
pushed a commit
that referenced
this pull request
May 16, 2025
PR-URL: #58141 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
aduh95
pushed a commit
that referenced
this pull request
Jun 10, 2025
PR-URL: #58141 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-explanatory cc @nodejs/buffer