Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fix: List length error
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed Aug 2, 2024
1 parent 1da7bdd commit 751ce14
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class BlueberryCommandsUtils {
static List<List<T>> splitArrayByLength<T>(List<T> arr, int length) {
List<List<T>> result = [];
for (int i = 0; i < arr.length; i += length) {
result.add(arr.sublist(i, i + length));
int end = (i + length < arr.length) ? i + length : arr.length;
result.add(arr.sublist(i, end));
}
return result;
}
Expand Down

0 comments on commit 751ce14

Please sign in to comment.