fixed slicing for images with the condition totalPixels/threadCount != Integer
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user