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

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-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 RafaelGSS July 14, 2023 18:58
@mhdawson
Copy link
Member Author

This is the reported coverity warning:

   if (node->children.size()) {
 93      int 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.
 94      for (const auto pair : node->children) {

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

@RafaelGSS
Copy link
Member

See: #48770

Signed-off-by: Michael Dawson <mdawson@devrus.com>
@mhdawson
Copy link
Member Author

ok see its been covered.

@mhdawson mhdawson closed this Jul 18, 2023
Sign up for free to 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-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants