diff --git a/src/muParserBase.cpp b/src/muParserBase.cpp index 5ffbb49..1ee8875 100644 --- a/src/muParserBase.cpp +++ b/src/muParserBase.cpp @@ -1903,7 +1903,8 @@ namespace mu #endif omp_set_num_threads(nMaxThreads); -#pragma omp parallel for schedule(static, std::max(nBulkSize/nMaxThreads, 1)) private(nThreadID) + const int chunkSize = std::max(nBulkSize/nMaxThreads, 1); +#pragma omp parallel for schedule(static, chunkSize) private(nThreadID) for (i = 0; i < nBulkSize; ++i) { nThreadID = omp_get_thread_num();