Skip to content

Comments

Remove duplicate typeof(decimal) check in IsKnownComparable<T>#124737

Merged
stephentoub merged 1 commit intodotnet:mainfrom
prozolic:isknowncomparable
Feb 23, 2026
Merged

Remove duplicate typeof(decimal) check in IsKnownComparable<T>#124737
stephentoub merged 1 commit intodotnet:mainfrom
prozolic:isknowncomparable

Conversation

@prozolic
Copy link
Contributor

In Constants.IsKnownComparable<T>(), the condition typeof(T) == typeof(decimal) appeared twice.
Therefore, I have removed the duplicated check.

In Constants.IsKnownComparable<T>(), the condition
`typeof(T) == typeof(decimal)` appeared twice.
Therefore, I have removed the duplicated check.
Copilot AI review requested due to automatic review settings February 23, 2026 02:22
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 23, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

@stephentoub stephentoub marked this pull request as ready for review February 23, 2026 02:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes a redundant typeof(T) == typeof(decimal) clause from Constants.IsKnownComparable<T>() in System.Collections.Frozen, keeping the method’s known-comparable whitelist functionally identical while avoiding duplicate logic.

Changes:

  • Removed the duplicated typeof(T) == typeof(decimal) check in Constants.IsKnownComparable<T>().

@stephentoub stephentoub enabled auto-merge (squash) February 23, 2026 02:23
@stephentoub stephentoub merged commit 0ff5be7 into dotnet:main Feb 23, 2026
94 of 98 checks passed
@hez2010
Copy link
Contributor

hez2010 commented Feb 23, 2026

Maybe worth to add BFloat16 to this table as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Collections community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants