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

Better handling of min version merging in DependencyList #4997

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Nov 21, 2024

[Cherry pick #4987 to 1.9]

Likely fix for #4972

Change

Use std::optional overloaded operator to handle all of the comparisons in DependencyList::Add. The operator already properly handles all of the cases, including treating std::nullopt as always less than a defined value.

Also optimize a few other places around a reference to MinVersion.

Validation

Added a unit test covering the cases where Add needs to merge the minimum version value.

Microsoft Reviewers: Open in CodeFlow

)

Likely fix for microsoft#4972

## Change
Use `std::optional` overloaded operator to handle all of the comparisons
in `DependencyList::Add`. The operator already properly handles all of
the cases, including treating `std::nullopt` as always less than a
defined value.

Also optimize a few other places around a reference to `MinVersion`.

## Validation
Added a unit test covering the cases where `Add` needs to merge the
minimum version value.
@JohnMcPMS JohnMcPMS requested a review from a team as a code owner November 21, 2024 23:39
@JohnMcPMS JohnMcPMS merged commit 5a646a7 into microsoft:release-v1.9 Nov 22, 2024
4 checks passed
@JohnMcPMS JohnMcPMS deleted the cp-badopt-1.9 branch November 22, 2024 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants