Skip to content

Commit 7bfc04a

Browse files
Redundant lock_guard scoping
1 parent 5669e89 commit 7bfc04a

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -802,22 +802,19 @@ struct Factorizer {
802802
}
803803
}
804804

805-
// For lock_guard scope
806-
if (true) {
807-
std::lock_guard<std::mutex> lock(batchMutex);
808-
// Insert the number if it isn't found (in a binary search) of the accepted set.
809-
if (smoothNumberSet.find(candidate) == smoothNumberSet.end()) {
810-
smoothNumberSet.insert(candidate);
811-
smoothNumberKeys.push_back(candidate);
812-
smoothNumberValues.push_back(rfv);
813-
// If we have enough rows for Gaussian elimination already,
814-
// so there's no reason to sieve any further.
815-
if (smoothNumberKeys.size() > rowLimit) {
816-
isIncomplete = false;
817-
smoothNumberSet.clear();
818-
819-
return 1U;
820-
}
805+
std::lock_guard<std::mutex> lock(batchMutex);
806+
// Insert the number if it isn't found (in a binary search) of the accepted set.
807+
if (smoothNumberSet.find(candidate) == smoothNumberSet.end()) {
808+
smoothNumberSet.insert(candidate);
809+
smoothNumberKeys.push_back(candidate);
810+
smoothNumberValues.push_back(rfv);
811+
// If we have enough rows for Gaussian elimination already,
812+
// so there's no reason to sieve any further.
813+
if (smoothNumberKeys.size() > rowLimit) {
814+
isIncomplete = false;
815+
smoothNumberSet.clear();
816+
817+
return 1U;
821818
}
822819
}
823820
}

0 commit comments

Comments
 (0)