Skip to content

Conversation

@mhdawson
Copy link
Member

  • address recent coverity warning by using auto &. Since the value is already const using a copy should not be necessary.

- address recent coverity warning by using auto &. Since the value is already const using a copy should not be necessary. Signed-off-by: Michael Dawson <[email protected]>
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 14, 2023
@mhdawsonmhdawson requested a review from RafaelGSSJuly 14, 2023 18:58
@mhdawson
Copy link
MemberAuthor

This is the reported coverity warning:

if (node->children.size()){93int child = 0; CID 322084 (#1 of 1): AUTO_CAUSES_COPY (AUTO_CAUSES_COPY) 1. auto_causes_copy: Using the auto keyword without an & causes the copy of an object of type pair. Use auto & instead of auto. 94for (constauto pair : node->children){

Since pair is const, it seems to make sense to avoid a copy byusing auto &

@RafaelGSS
Copy link
Member

See: #48770

@mhdawson
Copy link
MemberAuthor

ok see its been covered.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mhdawson@nodejs-github-bot@RafaelGSS