Skip to content

Commit 2cdbfd6

Browse files
committed
Update ArrayUtilities.java
1 parent 7b658fd commit 2cdbfd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/utils/arrays/ArrayUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static <T> List<T> getListPartition(List<T> originalList, int partitionSi
7575
*/
7676
public static int getPartitionCount(int listSize, int partitionSize){
7777
int partitionCount = listSize / partitionSize;
78-
return listSize % partitionCount == 0 ? partitionCount : partitionCount + 1;
78+
return listSize <= partitionSize ? 1 : (listSize % partitionCount == 0 ? partitionCount : partitionCount + 1);
7979
}
8080
}
8181

0 commit comments

Comments
 (0)