Skip to content

permission: fix recent coverity warning - #48775

Closed
mhdawson wants to merge 2 commits into
nodejs:mainfrom
mhdawson:coverity-30
Closed

permission: fix recent coverity warning#48775
mhdawson wants to merge 2 commits into
nodejs:mainfrom
mhdawson:coverity-30

Conversation

@mhdawson

Copy link
Copy Markdown
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 <mdawson@devrus.com>
@nodejs-github-bot

Copy link
Copy Markdown
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
@mhdawson
mhdawson requested a review from RafaelGSSJuly 14, 2023 18:58
@mhdawson

Copy link
Copy Markdown
MemberAuthor

This is the reported coverity warning:

if (node->children.size()) {
93int child = 0;
CID322084 (#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
Copy Markdown
Member

See: #48770

Signed-off-by: Michael Dawson <mdawson@devrus.com>
@mhdawson

Copy link
Copy Markdown
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