MCPcopy Create free account
hub / github.com/M66B/FairEmail / chunkList

Method chunkList

app/src/main/java/eu/faircode/email/Helper.java:3871–3878  ·  view source on GitHub ↗
(List<T> list, int size)

Source from the content-addressed store, hash-verified

3869 }
3870
3871 static <T> List<List<T>> chunkList(List<T> list, int size) {
3872 if (list == null || list.isEmpty())
3873 return new ArrayList<>();
3874 List<List<T>> result = new ArrayList<>(list.size() / size);
3875 for (int i = 0; i < list.size(); i += size)
3876 result.add(new ArrayList<>(list.subList(i, i + size < list.size() ? i + size : list.size())));
3877 return result;
3878 }
3879
3880 static int[] toIntArray(List<Integer> list) {
3881 int[] result = new int[list.size()];

Callers 2

onPurgeFolderMethod · 0.95
doCommandMethod · 0.95

Calls 3

sizeMethod · 0.65
isEmptyMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected