Permalink
Browse files

make Dog a struct

  • Loading branch information...
camilin87 committed Feb 1, 2016
1 parent dffbd97 commit b756e87a63abec9ea8c069bc5d9c09b2a2376311
Showing with 1 addition and 15 deletions.
  1. +1 −15 Program.cs
@@ -3,7 +3,7 @@

namespace consoleapplication1
{
public class Dog
public struct Dog
{
public int Weight { get; }
public string Name { get; }
@@ -13,20 +13,6 @@ public Dog(string name, int weight)
this.Name = name;
this.Weight = weight;
}

public override bool Equals(object obj)
{
var that = (Dog)obj;
return this.Weight == that.Weight && this.Name == that.Name;
}

public override int GetHashCode()
{
unchecked
{
return (Weight * 397) ^ (Name != null ? Name.GetHashCode() : 0);
}
}
}

public class Program

0 comments on commit b756e87

Please sign in to comment.