-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
There was a problem hiding this 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.
rules/S2955/csharp/rule.adoc
Outdated
@@ -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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(EqualityComparer<T>.Default.Equals(value, default(T))) | |
if (EqualityComparer<T>.Default.Equals(value, default(T))) |
Quality Gate passed for 'rspec-frontend'Issues Measures |
Quality Gate passed for 'rspec-tools'Issues Measures |
Provide a better solution, that does not box value types to
object
.For more details, see this thread.