mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-03 22:26:56 +02:00
Chunk by range
This commit is contained in:
@@ -3789,6 +3789,8 @@ public class Helper {
|
||||
}
|
||||
|
||||
static <T> List<List<T>> chunkList(List<T> list, int size) {
|
||||
if (list == null || list.isEmpty())
|
||||
return new ArrayList<>();
|
||||
List<List<T>> result = new ArrayList<>(list.size() / size);
|
||||
for (int i = 0; i < list.size(); i += size)
|
||||
result.add(list.subList(i, i + size < list.size() ? i + size : list.size()));
|
||||
|
||||
Reference in New Issue
Block a user