Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement .Equals and .GetHashCode to fix warning
  • Loading branch information
christabella committed Jan 12, 2021
commit 67928e1078b6290c781a4ed789177f4a7dc6e9cd
11 changes: 11 additions & 0 deletions src/embed_tests/TestOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ public class OperableObject
{
public int Num { get; set; }

public override int GetHashCode()
{
return 159832395 + Num.GetHashCode();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unchecked(159832395 + Num.GetHashCode())

}

public override bool Equals(object obj)
{
return obj is OperableObject @object &&
Num == @object.Num;
}

public OperableObject(int num)
{
Num = num;
Expand Down