We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b658fd commit 2cdbfd6Copy full SHA for 2cdbfd6
src/main/java/utils/arrays/ArrayUtilities.java
@@ -75,7 +75,7 @@ public static <T> List<T> getListPartition(List<T> originalList, int partitionSi
75
*/
76
public static int getPartitionCount(int listSize, int partitionSize){
77
int partitionCount = listSize / partitionSize;
78
- return listSize % partitionCount == 0 ? partitionCount : partitionCount + 1;
+ return listSize <= partitionSize ? 1 : (listSize % partitionCount == 0 ? partitionCount : partitionCount + 1);
79
}
80
81
0 commit comments