Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationEqualityComparer.cs
- Timestamp:
- 03/18/19 17:24:30 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.PermutationEncoding
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationEqualityComparer.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 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.