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

Modify S2955 C#: Fix compliant solution #3794

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

gregory-paidis-sonarsource
Copy link
Contributor

@gregory-paidis-sonarsource gregory-paidis-sonarsource commented Mar 20, 2024

Provide a better solution, that does not box value types to object.
For more details, see this thread.

Copy link
Contributor

@antonioaversa antonioaversa left a comment

Choose a reason for hiding this comment

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

LGTM, left a minor, non-blocking remark.

@@ -30,7 +30,7 @@ bool IsDefault<T>(T value)
----
bool IsDefault<T>(T value)
{
if(object.Equals(value, default(T)))
if(EqualityComparer<T>.Default.Equals(value, default(T)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(EqualityComparer<T>.Default.Equals(value, default(T)))
if (EqualityComparer<T>.Default.Equals(value, default(T)))

Copy link

Quality Gate passed Quality Gate passed for 'rspec-frontend'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link

Quality Gate passed Quality Gate passed for 'rspec-tools'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@gregory-paidis-sonarsource gregory-paidis-sonarsource merged commit 68350b2 into master Mar 20, 2024
8 of 10 checks passed
@gregory-paidis-sonarsource gregory-paidis-sonarsource deleted the greg/fix-S2955-compliant branch March 20, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants