Skip to content

Commit bbb98b8

Browse files
Fix exit condition after G.E.
1 parent 66a3d06 commit bbb98b8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,15 @@ struct Factorizer {
999999
}
10001000
}
10011001

1002-
// All work has been dispatched, but now we must complete it.
1003-
dispatch.finish();
1002+
if (result == 1U) {
1003+
// The result has not yet been found.
1004+
// A succesful item will dump the queue.
1005+
dispatch.finish();
1006+
} else {
1007+
// The result has been found.
1008+
// If any work remains, dump it.
1009+
dispatch.dump();
1010+
}
10041011

10051012
// Depending on row count, a successful result should be nearly guaranteed.
10061013
return result;

0 commit comments

Comments
 (0)