Changeset 15067 for trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorEqualityComparer.cs
- Timestamp:
- 06/26/17 23:13:15 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorEqualityComparer.cs
r14659 r15067 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 24 using HeuristicLab.PluginInfrastructure; 23 25 24 26 namespace HeuristicLab.Encodings.IntegerVectorEncoding { 27 [NonDiscoverableType] 25 28 public class IntegerVectorEqualityComparer : EqualityComparer<IntegerVector> { 26 29 public override bool Equals(IntegerVector x, IntegerVector y) { 27 30 if (x == null && y == null) return true; 28 31 if (x == null || y == null) return false; 32 if (ReferenceEquals(x, y)) return true; 29 33 if (x.Length != y.Length) return false; 30 34 for (var i = 0; i < x.Length; i++) … … 34 38 35 39 public override int GetHashCode(IntegerVector obj) { 40 if (obj == null) throw new ArgumentNullException("obj", "IntegerVectorEqualityComparer: Cannot compute hash value of null."); 36 41 unchecked { 37 42 int hash = 17;
Note: See TracChangeset
for help on using the changeset viewer.