Changeset 14875 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/StatelessExpression.cs
- Timestamp:
- 04/18/17 01:15:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/StatelessExpression.cs
r14733 r14875 1 1 namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions { 2 2 public abstract class StatelessExpression : Expression { 3 private readonly int hashCode; 3 private int hashCode; 4 4 5 protected StatelessExpression() { 5 this.hashCode = this.GetType().GetHashCode();6 hashCode = GetType().GetHashCode(); 6 7 } 7 8 8 9 public override int GetHashCode() { 9 return this.hashCode;10 return hashCode; 10 11 } 11 12 12 13 public override bool Equals(object obj) { 13 return ReferenceEquals(this, obj); 14 return ReferenceEquals(this, obj) || 15 hashCode == obj.GetHashCode(); 14 16 } 15 17 }
Note: See TracChangeset
for help on using the changeset viewer.