Skip to content

Commit

Permalink
Update order.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Jan 26, 2025
1 parent dee2b15 commit 4dfffe9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ export function prepareOrdersForRound(
for (const [, ownerProfile] of ownersProfileMap) {
let remainingLimit = ownerProfile.limit;
// consume orders limits
const allOrders = Array.from(ownerProfile.orders).flatMap(
([, orderProfile]) => orderProfile.takeOrders,
);
const allOrders: Pair[] = [];
ownerProfile.orders.forEach((v) => allOrders.push(...v.takeOrders));
const consumingOrders = allOrders.splice(ownerProfile.lastIndex, remainingLimit);
remainingLimit -= consumingOrders.length;
ownerProfile.lastIndex += consumingOrders.length;
Expand Down

0 comments on commit 4dfffe9

Please sign in to comment.