Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilProfile1D.cs =================================================================== diff -u -r140635b34616f25ca853982955976632b6000c52 -r42357a100d1a75baca233aa44b866a5009f48e00 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilProfile1D.cs (.../MacroStabilityInwardsSoilProfile1D.cs) (revision 140635b34616f25ca853982955976632b6000c52) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsSoilProfile1D.cs (.../MacroStabilityInwardsSoilProfile1D.cs) (revision 42357a100d1a75baca233aa44b866a5009f48e00) @@ -126,7 +126,7 @@ public override string ToString() { - return Name ?? string.Empty; + return Name; } public override bool Equals(object obj) @@ -139,8 +139,11 @@ { return true; } - var other = obj as MacroStabilityInwardsSoilProfile1D; - return other != null && Equals((MacroStabilityInwardsSoilProfile1D) obj); + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((MacroStabilityInwardsSoilProfile1D) obj); } public override int GetHashCode() @@ -153,7 +156,7 @@ hashCode = (hashCode * 397) ^ layer.GetHashCode(); } hashCode = (hashCode * 397) ^ Bottom.GetHashCode(); - hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0); + hashCode = (hashCode * 397) ^ Name.GetHashCode(); return hashCode; } } @@ -189,7 +192,7 @@ /// /// The collection of to validate. /// Thrown when is null. - /// Thrown when + /// Thrown when: /// /// contains no layers /// contains a layer with the less than