Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
src: fix coverity coverity warning#50846
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
Merged
Merged
Uh oh!
There was an error while loading. Please reload this page.
Conversation
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
Member
mhdawson commented Nov 21, 2023
- reduce copying by using std::move
MemberAuthor
mhdawson commented Nov 21, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Coverity warning std::vector<Local<String>> params ={1464String::NewFromUtf8(isolate, "exports").ToLocalChecked(), 1465String::NewFromUtf8(isolate, "require").ToLocalChecked(), 1466String::NewFromUtf8(isolate, "module").ToLocalChecked(), 1467String::NewFromUtf8(isolate, "__filename").ToLocalChecked(), 1468String::NewFromUtf8(isolate, "__dirname").ToLocalChecked()}; 14691470 TryCatchScope try_catch(env); 14711472ContextifyContext::CompileFunctionAndCacheResult(env, 1473 context, 1474 &source, CID 329955 (#1 of 1): COPY_INSTEAD_OF_MOVE (COPY_INSTEAD_OF_MOVE) 1. copy_constructor_call: params is passed-by-value as parameter to CompileFunctionAndCacheResult when it could be moved instead. Use std::move(params) instead of params. 1475 params, 1476 std::vector<Local<Object>>(), 1477 options, 1478 true, 1479 id_symbol, 1480 try_catch);I think the suggested std::move will avoid copying the contents of the vector. |
tniessen approved these changes Nov 21, 2023
Member
tniessen commented Nov 21, 2023
Nit: duplicate word in commit message |
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]>
MemberAuthor
mhdawson commented Nov 22, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@tniessen thanks, fixed commit message. |
Collaborator
nodejs-github-bot commented Nov 22, 2023
marco-ippolito approved these changes Nov 22, 2023
Collaborator
nodejs-github-bot commented Nov 23, 2023
Collaborator
nodejs-github-bot commented Nov 23, 2023
jasnell approved these changes Nov 24, 2023
lpinca approved these changes Nov 24, 2023
Collaborator
nodejs-github-bot commented Nov 24, 2023
Landed in 6dbf678 |
martenrichter pushed a commit to martenrichter/node that referenced this pull request Nov 26, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
lucshi pushed a commit to lucshi/node that referenced this pull request Nov 27, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Nov 27, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Merged
RafaelGSS pushed a commit that referenced this pull request Nov 29, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Nov 30, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Merged
UlisesGascon pushed a commit that referenced this pull request Dec 13, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 15, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 19, 2023
- reduce copying by using std::move Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50846 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Sign up for freeto 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.