pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.11k stars 2.05k forks source link

Avoid copy in iteration by using const auto & #4861

Closed oleksandr-pavlyk closed 9 months ago

oleksandr-pavlyk commented 9 months ago

Description

Coverity scan highlights AUTO_CAUSES_COPY issue:

image

Suggested changelog entry:

None.

rwgk commented 9 months ago

Thanks!

If you get a chance, could you please add the Coverty version information to the PR description?

Is/was this the only finding from that Coverty version?

oleksandr-pavlyk commented 9 months ago

I used

Coverity Static Analysis version 2023.3.0 on Linux 5.15.0-78-generic x86_64
Internal version numbers: 10201e8525 p-2023.3-push-55

there are multiple issues, some of which I reported: gh-4821, gh-4822, and gh-4814.

They are fished out of the large body of reports generated for IntelPython/dpctl project. I will keep looking out for more.

rwgk commented 9 months ago

I just commented on the two open ones. (I'm not sure if anyone is regularly looking at bugs here. Just speaking for myself: I'm only able to look at PRs.)