Skip to content
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

Fixing coverity issues in src/acl_usm.cpp #218

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

haoxian2
Copy link
Contributor

Fixing Type: AUTO_CAUSES_COPY (AUTO_CAUSES_COPY)
Error caused because auto in for-each loop copies the iterator object from the array/list.
Adding & to reference the original element.
Adding const so the code don't mistakenly modify the object.

Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @haoxian2! Could you copy your PR description to the body of the commit message? This makes it much easier to look up with git log etc.

@pcolberg pcolberg added this to the 2023.1 milestone Nov 30, 2022
@pcolberg pcolberg added the bug Something isn't working label Nov 30, 2022
@haoxian2
Copy link
Contributor Author

haoxian2 commented Dec 1, 2022

@pcolberg I changed the commit message to the PR description. Thank you for the suggestion!

@haoxian2 haoxian2 requested a review from pcolberg December 1, 2022 15:30
Error caused because auto in for-each loop copies the iterator object from the array/list.
Adding & to reference the original element.
Adding const so the code don't mistakenly modify the object.
@pcolberg
Copy link
Contributor

pcolberg commented Dec 1, 2022

Thanks @haoxian2! For git commit messages, it is customary to leave an empty line between the subject and the body:

--- old
+++ new
@@ -1,4 +1,5 @@
-Fixing coverity issue Type: AUTO_CAUSES_COPY (AUTO_CAUSES_COPY)
+acl_usm: Fix coverity issue Type: AUTO_CAUSES_COPY
+
 Error caused because auto in for-each loop copies the iterator object from the array/list.
 Adding & to reference the original element.
 Adding const so the code don't mistakenly modify the object.

@pcolberg pcolberg merged commit f8e3a83 into intel:main Dec 1, 2022
@haoxian2 haoxian2 deleted the coverity-acl-usm branch December 1, 2022 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants