Skip to content

Commit 6c00bd2

Browse files
haoxian2pcolberg
authored andcommitted
Fixed coverity issue in acl_context.cpp: Type: AUTO_CAUSES_COPY (AUTO_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.
1 parent df770c0 commit 6c00bd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/acl_context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ void acl_idle_update(cl_context context) {
12021202
// firstly update the current context
12031203
acl_update_context(context);
12041204
// update the other contexts from the platform
1205-
for (auto _context : acl_platform.contexts_set) {
1205+
for (const cl_context _context : acl_platform.contexts_set) {
12061206
if (context != _context)
12071207
acl_update_context(_context);
12081208
}

0 commit comments

Comments
 (0)