Skip to content

Commit

Permalink
Avoid copy in iteration by using const auto & (#4861)
Browse files Browse the repository at this point in the history
This change is fixing a Coverity AUTO_CAUSES_COPY issues.
  • Loading branch information
oleksandr-pavlyk committed Sep 25, 2023
1 parent 5891867 commit 7e5edbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ class cpp_function : public function {
}
msg += "kwargs: ";
bool first = true;
for (auto kwarg : kwargs) {
for (const auto &kwarg : kwargs) {
if (first) {
first = false;
} else {
Expand Down

0 comments on commit 7e5edbc

Please sign in to comment.