Skip to content

Commit 997043c

Browse files
committed
if quantity = 0 we break
1 parent 921499e commit 997043c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/orderbook/OrderBookEngine.java

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public void onOrder(double price, int quantity, Side side) {
4242
removeAskOrder(ask_price, quantity);
4343
quantity = 0;
4444
}
45+
if (quantity == 0) {
46+
break;
47+
}
4548
}
4649
}
4750
if (quantity > 0) {
@@ -60,6 +63,9 @@ public void onOrder(double price, int quantity, Side side) {
6063
removeBidOrder(bid_price, quantity);
6164
quantity = 0;
6265
}
66+
if (quantity == 0) {
67+
break;
68+
}
6369
}
6470

6571
}

0 commit comments

Comments
 (0)