-
Notifications
You must be signed in to change notification settings - Fork 34
Fix unchecked optional access warnings in tracking algorithms #2034
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
base: main
Are you sure you want to change the base?
Changes from 12 commits
0984b98
06c09b2
0964663
349b239
9a6c581
a94bf14
3a4def9
c2623ad
2da8d9f
eac73f4
eb4deb2
4bd06c3
28b7f2c
7d05447
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -316,8 +316,16 @@ TrackPropagation::propagate(const edm4eic::Track& /* track */, | |
| m_log->trace(" propagation result is OK"); | ||
|
|
||
| // Pulling results to convenient variables | ||
| auto trackStateParams = *((*result).endParameters); | ||
| const auto& parameter = trackStateParams.parameters(); | ||
| if (!(*result).endParameters.has_value()) { | ||
| m_log->trace(" propagation failed (endParameters not available)"); | ||
| return nullptr; | ||
| } | ||
| auto trackStateParams = *((*result).endParameters); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot Surely now this one remaining bugprone-unchecked-optional-access warning is a false positive. |
||
| const auto& parameter = trackStateParams.parameters(); | ||
| if (!trackStateParams.covariance().has_value()) { | ||
| m_log->trace(" propagation failed (covariance not available)"); | ||
| return nullptr; | ||
| } | ||
| const auto& covariance = *trackStateParams.covariance(); | ||
|
|
||
| // Path length | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.