fixed slicing for images with the condition totalPixels/threadCount != Integer

This commit is contained in:
darkress
2023-06-11 03:55:27 +02:00
parent 78d67a32eb
commit 3d5749ca71

View File

@@ -91,9 +91,11 @@ class Main
public static String[] prepareThreadArray(ArrayList<String> fullArray, int threadNumber, int threadCount)
{
String[] threadArray = new String[fullArray.size()/threadCount];
int count = 0;
for(int i = (threadNumber*fullArray.size())/threadCount; i < ((threadNumber+1)*fullArray.size())/threadCount; i++)
int arrayStart = (threadNumber*fullArray.size())/threadCount;
int arrayEnd = ((threadNumber+1)*fullArray.size())/threadCount;
String[] threadArray = new String[arrayEnd-arrayStart];
for(int i = arrayStart; i < arrayEnd; i++)
{
threadArray[count] = fullArray.get(i);
count++;