Skip to content

Commit

Permalink
Fixed coverity issue in acl_context.cpp: Type: AUTO_CAUSES_COPY (AUTO…
Browse files Browse the repository at this point in the history
…_CAUSES_COPY)

Changed to `const cl_context _context` since coverity complains about the previous code auto _context would make an auto copy of the pointer contexts in acl_platform.contexts_set. Because `_context` is a pointer, a copy is equally as cheap as a reference, and to pass coverity which only mentions `auto` copy.
  • Loading branch information
haoxian2 committed Dec 8, 2022
1 parent 7de03cb commit f3c6fd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/acl_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ void acl_idle_update(cl_context context) {
// firstly update the current context
acl_update_context(context);
// update the other contexts from the platform
for (auto _context : acl_platform.contexts_set) {
for (const cl_context _context : acl_platform.contexts_set) {
if (context != _context)
acl_update_context(_context);
}
Expand Down

0 comments on commit f3c6fd5

Please sign in to comment.