fix OrderVM.Equals stack overflow

This commit is contained in:
John Colvin committed 2018-02-19 16:51:34 -05:00
1 parent 7feda2a1c5
commit 4d44e32b34
1 file changed
+5 -5
@@ -89,11 +89,6 @@ namespace mbts.spark {
public Brush border { get; private set; }
public double opacity => has_parent ? 0.5 : 1.0;
bool IEquatable<OrderVM>.Equals(OrderVM other) =>
this.safe_equals(other, (a, b) => a.id == b.id);
public override bool Equals(object obj) => Equals(obj as OrderVM);
public override int GetHashCode() => id.GetHashCode();
public async void try_set_price(double newprice) {
_phantom_price = newprice;
RaisePropertyChanged(nameof(price));
@@ -104,5 +99,10 @@ namespace mbts.spark {
_phantom_price = double.NaN;
RaisePropertyChanged(nameof(price));
}
public override bool Equals(object obj) => this.safe_equals(obj as OrderVM, _non_null_equals);
public override int GetHashCode() => id.GetHashCode();
public bool Equals(OrderVM other) => this.safe_equals(other, _non_null_equals);
static bool _non_null_equals(OrderVM x, OrderVM y) => x.id == y.id;
}
}