Skip to content

Commit 4d67c6a

Browse files
Avoid copy in iteration by using auto &
This change is fixing a Coverity AUTO_CAUSES_COPY issues.
1 parent 5891867 commit 4d67c6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/pybind11.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ class cpp_function : public function {
11421142
}
11431143
msg += "kwargs: ";
11441144
bool first = true;
1145-
for (auto kwarg : kwargs) {
1145+
for (auto &kwarg : kwargs) {
11461146
if (first) {
11471147
first = false;
11481148
} else {

0 commit comments

Comments
 (0)