Created
February 6, 2021 02:34
-
-
Save wf-adamhei/52058ee7d5ddf2e7fe1c751b6d5cdf67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def partitionTestClassNames(classNames, buckets) { | |
def subArrays = [] | |
def bucketSize = classNames.size() / buckets | |
for (int i = 0; i < buckets; i++) { | |
def start = i * bucketSize | |
def end = i == buckets - 1 ? classNames.size() : start + bucketSize | |
subArrays += [classNames[start..<end]] | |
} | |
return subArrays | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment