/// <inheritdoc /> public override int GetHashCode(HclEvent obj) { if (obj is MappingKey mk) { return(mk.Path.GetHashCode()); } return(obj.GetHashCode()); }
/// <inheritdoc /> public override bool Equals(HclEvent other) { if (base.Equals(other) && other is Scalar scalar) { return(this.Value == scalar.Value); } return(false); }
/// <inheritdoc /> public override int GetHashCode(HclEvent obj) { if (obj is Scalar scalar && scalar.Value != null) { return(scalar.Value.GetHashCode()); } // Null valued scalars are equivalent by virtue of being the same type. return(obj.Type.GetHashCode()); }
/// <inheritdoc /> public override bool Equals(HclEvent other) { if (other is null) { return(false); } if (object.ReferenceEquals(this, other)) { return(true); } if (other is MappingKey mk) { return(this.Path == mk.Path); } return(false); }