static int GetBestWorkerNumber (int from, int to, ParallelOptions options, out int step)
{
- int num = Math.Min (GetBestWorkerNumber (options.TaskScheduler),
- options != null && options.MaxDegreeOfParallelism != -1 ? options.MaxDegreeOfParallelism : int.MaxValue);
+ int num = GetBestWorkerNumber(options.TaskScheduler);
+ if (options != null && options.MaxDegreeOfParallelism != -1)
+ num = options.MaxDegreeOfParallelism;
// Integer range that each task process
if ((step = (to - from) / num) < 5) {
step = 5;