Changeset 15256 for branches/PerformanceComparison/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationEqualityComparer.cs
- Timestamp:
- 07/15/17 14:25:44 (7 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.Encodings.PermutationEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Encodings.PermutationEncoding
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationEqualityComparer.cs
r14600 r15256 30 30 public class PermutationEqualityComparer : EqualityComparer<Permutation> { 31 31 public override bool Equals(Permutation x, Permutation y) { 32 if (ReferenceEquals(x, y)) return true; 33 if (x == null || y == null) return false; 34 if (x.Length != y.Length) return false; 32 35 if (x.PermutationType != y.PermutationType) return false; 33 if (x.Length != y.Length) return false;34 36 switch (x.PermutationType) { 35 37 case PermutationTypes.Absolute: … … 67 69 68 70 public override int GetHashCode(Permutation obj) { 69 if (obj == null) return 0;71 if (obj == null) throw new ArgumentNullException("obj", "PermutationEqualityComparer: Cannot compute hash value of null."); 70 72 return GenerateHashString(obj).GetHashCode(); 71 73 }
Note: See TracChangeset
for help on using the changeset viewer.