main.cpp: Set the number of threads used by OpenMP to one when parallel is false
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
8341096773
commit
5c1780a9af
|
@ -38,7 +38,10 @@ int main(int argc, char* argv[]) {
|
|||
} else goto invalid_argument;
|
||||
}
|
||||
else if (currentArgument == ArgumentShort("text")) printResult = text_provided = true;
|
||||
else if (text_provided || currentArgument.ends_with(".ybcon"))
|
||||
else if (text_provided || currentArgument.ends_with(".ybcon")) {
|
||||
#ifdef _OPENMP
|
||||
if (not parallel) omp_set_num_threads(1);
|
||||
#endif
|
||||
Units.insert_or_assign(currentArgument, async(not parallel ? launch::deferred : launch::async, [currentArgument, &text_provided, &target, &newLines]() {
|
||||
unit_result resultingPair;
|
||||
try {
|
||||
|
@ -61,7 +64,7 @@ int main(int argc, char* argv[]) {
|
|||
}
|
||||
return resultingPair;
|
||||
}));
|
||||
else {
|
||||
} else {
|
||||
if (argc == 2) {
|
||||
if (currentArgument == Argument("version")) {
|
||||
cout << Yerbacon::getVersion();
|
||||
|
|
Loading…
Reference in New Issue