Skip to content

Commit

Permalink
Merge pull request #285 from b123400/fix-284
Browse files Browse the repository at this point in the history
  • Loading branch information
zdavatz authored Aug 7, 2024
2 parents 1b84ff2 + d221742 commit bb9ee9c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@ private Order tryWithBatchSize(String prefix, String suffix, List<String> itemSt
Order thisOrder = orders.get(0);
if (order == null) {
order = thisOrder;
// Remove last, as the last one will be added later
order.orderItems.remove(order.orderItems.size() - 1);
} else {
for (int j = 0; j < thisOrder.orderItems.size() - 1; j++) {
order.orderItems.add(thisOrder.orderItems.get(0));
OrderItem oi = thisOrder.orderItems.get(j);
order.orderItems.add(oi);
}
}
if (i + batchSize >= itemStrings.size()) {
order.orderItems.add(thisOrder.orderItems.get(thisOrder.orderItems.size() - 1));
OrderItem oi = thisOrder.orderItems.get(thisOrder.orderItems.size() - 1);
order.orderItems.add(oi);
}
}
} catch (Exception e) {
Expand Down

0 comments on commit bb9ee9c

Please sign in to comment.