diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 33e373b760de..c2e838bd5e2f 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2240,8 +2240,8 @@ void MergeNoTailSection::finalizeContents() { // operations in the following tight loop. size_t Concurrency = 1; if (Config->Threads) - if (int N = std::thread::hardware_concurrency()) - Concurrency = std::min(PowerOf2Floor(N), NumShards); + Concurrency = + std::min(PowerOf2Floor(hardware_concurrency()), NumShards); // Add section pieces to the builders. parallelForEachN(0, Concurrency, [&](size_t ThreadId) {