OrderBook - defer_refresh causing strange behavior when sorting, taking it out

This commit is contained in:
Jake Norbut committed 2018-03-13 20:15:54 -05:00
1 parent 4f5f072bb5
commit b4e134599c
1 file changed
+8 -10
@@ -220,16 +220,14 @@ namespace mbts.spark {
// check if this defer is good, seems like it since we are clearing orders then adding them back
// clear is necessary because _ordes aren't actually changing, just the sorting in whichy they appear is
if (_get_comparer_for_column(column, out Comparer<OrderBookRowVM> sorter)) {
using (_visible_orders.defer_refresh()) {
SortedTree<OrderBookRowVM, uint> forest = new SortedTree<OrderBookRowVM, uint>(
sorter
, row_vm => row_vm.order.Key
, row_vm => row_vm.order.ParentKey
, _orders
);
_orders.Clear();
_orders.sync_with(forest);
}
SortedTree<OrderBookRowVM, uint> forest = new SortedTree<OrderBookRowVM, uint>(
sorter
, row_vm => row_vm.order.Key
, row_vm => row_vm.order.ParentKey
, _orders
);
_orders.Clear();
_orders.sync_with(forest);
return true;
}
return false;