mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 11:55:20 +01:00
Prevent too long IMAP commands
This commit is contained in:
@@ -576,6 +576,13 @@ public class Helper {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("pro", false);
|
||||
}
|
||||
|
||||
public static <T> List<List<T>> chunkList(List<T> list, int size) {
|
||||
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()));
|
||||
return result;
|
||||
}
|
||||
|
||||
static long[] toLongArray(List<Long> list) {
|
||||
long[] result = new long[list.size()];
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
|
||||
Reference in New Issue
Block a user