Skip to content

Commit afa264e

Browse files
Fix exit condition after G.E.
1 parent 09ffb58 commit afa264e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,9 @@ struct Factorizer {
947947
// For lock_guard scope
948948
if (true) {
949949
std::lock_guard<std::mutex> lock(batchMutex);
950+
if (!isIncomplete) {
951+
break;
952+
}
950953
dispatch.dispatch([this, i, ikit, ivit, &result]() -> bool {
951954
auto jkit = ikit;
952955
auto jvit = ivit;
@@ -990,10 +993,6 @@ struct Factorizer {
990993

991994
return false;
992995
});
993-
// Still in lock_guard scope:
994-
if (!isIncomplete) {
995-
break;
996-
}
997996
}
998997
// If we are still dispatching items in the queue,
999998
// they probably won't have completed, but let

0 commit comments

Comments
 (0)