Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity fixes (3.40 backport) #60572

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

nyalldawson
Copy link
Collaborator

Manual backport of #60555

The warning is a false positive, since we were already checking
that the optional has a value before accessing it. But we can
avoid the exception altogether (and gain some performance) by
using the std::optional dereference operator, which DOES not
throw and which relies on the previous has_value check to avoid
undefined behavior.

(cherry picked from commit e3762c5)
@nyalldawson nyalldawson added the Backport Is a backport of another pull request label Feb 12, 2025
@github-actions github-actions bot added this to the 3.40.4 milestone Feb 12, 2025
Copy link

github-actions bot commented Feb 12, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 69653c3)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 69653c3)

@lbartoletti lbartoletti merged commit 9c5202f into qgis:release-3_40 Feb 13, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport Is a backport of another pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants