-
Notifications
You must be signed in to change notification settings - Fork 30k
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: apply clang-tidy rule performance-unnecessary-value-param #26042
Conversation
9e5dae3
to
fdd0d8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ambivalent of this change...
IMHO it has pros:
- Use of
clang-tidy
as an automated semantic tool - Improve semantics of some APIs
- possible performance improvement
Cons:
- One-time use of automated tool (will regress without CI)
- Impair semantics of some APIs (esp. WRT to shared_ptr)
- performance impact non obvious. Adding
<utility>
has compile time impact. - non K.I.S.S. use of value semantics
@gengjiawen I like the idea of using clang-tidy. I'm not 100% sure about this specific implementation... Lite-CI: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/2569/ |
@refack Maybe start an issue to start talk about |
I use MSVS2017/9 which also has builtin clang-tidy integration (e.g. #23793). I also use Resharper (also by JetBrains) and sometimes I use CLion. I agree that proper use of better tools should allow us to improve our codebase. We have had a bit of discussion around clang-tidy - https://github.com/nodejs/node/search?q=clang-tidy&type=Issues I'd be happy to hear other contributors' opinions. |
I found MSVS2017 is pretty lame in handling cpp tbh. |
fdd0d8e
to
fe34e44
Compare
@addaleax Any thought on this clang-tidy rule ? |
@gengjiawen I don’t know … if the compiler can optimize this away (and it should), then yeah, I don’t know and I don’t think I have much to add to what the others here have said. I do like the changes to |
Should we start an issue to discuss https://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-value-param.html with node cpp team (I am not sure it exists) ? Or just keep the change |
I think this PR is that issue :) I have no strong feelings either way. |
I'm +1 on the I'm -0 on the changes that add I'm -1 on changes that put |
@refack I will try to do revert the |
fe34e44
to
ec6bcaa
Compare
CI: https://ci.nodejs.org/job/node-test-pull-request/20799/ (:heavy_check_mark:) |
@danbev Can you import this change ? Thanks. |
Landed in 8375c70. |
PR-URL: #26042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Thanks. |
PR-URL: #26042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #26042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Fix clang-tidy issue https://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-value-param.html.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes