Skip to content

Commit f109feb

Browse files
committed
perf: avoid check best price
1 parent 3754b63 commit f109feb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/orderbook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ export class OrderBook {
9999
}
100100

101101
while (size > 0 && sideToProcess.len() > 0) {
102+
// if sideToProcess.len > 0 it is not necessary to verify that bestPrice exists
102103
const bestPrice = iter()
103-
if (!bestPrice) break
104104
const { done, partial, partialQuantityProcessed, quantityLeft } =
105-
this.processQueue(bestPrice, size)
105+
this.processQueue(bestPrice as OrderQueue, size)
106106
response.done = response.done.concat(done)
107107
response.partial = partial
108108
response.partialQuantityProcessed = partialQuantityProcessed

0 commit comments

Comments
 (0)