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

create_intervention_scenario: std::move risk_impacts to avoid copying #484

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

alexdewar
Copy link
Contributor

While I was mucking about in the code base, I noticed that we were missing an opportunity to std::move something in create_intervention_scenario(), so I've fixed it up.

@alexdewar alexdewar marked this pull request as ready for review August 7, 2024 14:52
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

PolicyDynamic dynamic)
: active_period{period}, impacts{sorted_impacts}, dynamic{std::move(dynamic)} {}
std::vector<PolicyImpact> sorted_impacts, PolicyDynamic dynamic)
: active_period{period}, impacts{std::move(sorted_impacts)}, dynamic{std::move(dynamic)} {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: std::move of the variable 'dynamic' of the trivially-copyable type 'PolicyDynamic' has no effect; remove std::move() [performance-move-const-arg]

Suggested change
: active_period{period}, impacts{std::move(sorted_impacts)}, dynamic{std::move(dynamic)} {}
: active_period{period}, impacts{std::move(sorted_impacts)}, dynamic{dynamic} {}

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

PolicyDynamic dynamic)
: active_period{period}, impacts{sorted_impacts}, dynamic{std::move(dynamic)} {}
std::vector<PolicyImpact> sorted_impacts, PolicyDynamic dynamic)
: active_period{period}, impacts{std::move(sorted_impacts)}, dynamic{std::move(dynamic)} {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: std::move of the variable 'dynamic' of the trivially-copyable type 'PolicyDynamic' has no effect; remove std::move() [performance-move-const-arg]

Suggested change
: active_period{period}, impacts{std::move(sorted_impacts)}, dynamic{std::move(dynamic)} {}
: active_period{period}, impacts{std::move(sorted_impacts)}, dynamic{dynamic} {}

Copy link
Contributor

@jamesturner246 jamesturner246 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Go ahead 👍

@alexdewar alexdewar merged commit 297d88b into main Aug 13, 2024
6 checks passed
@alexdewar alexdewar deleted the move_risk_impacts branch August 13, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants