-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Add] IEquatable
to Signer
#3571
[Add] IEquatable
to Signer
#3571
Conversation
|
||
public override bool Equals(object obj) | ||
{ | ||
if (obj == null) |
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.
== null already done in is sentence
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.
==
checks for null
and sends to this method.
if (other is null) return false; | ||
return Account == other.Account && | ||
Scopes == other.Scopes && | ||
AllowedContracts.AsSpan().SequenceEqual(other.AllowedContracts.AsSpan()) && |
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.
Serialize the object for compare seems very weird, and slow, i will fix it tomorrow
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.
Serialize the object for compare seems very weird, and slow, i will fix it tomorrow
What is serialized?
AllowedContracts
and AllowedGroups
are array.
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.
Serialize the object for compare seems very weird, and slow, i will fix it tomorrow
Span is faster and we don't have to check for null
.
Change Log
IEquatable
toSigner
classIEquatable
onSigner
classNeeds #3573
Type of change
How Has This Been Tested?
Test_IEquatable
Test Configuration:
Checklist: