-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix double-decoration error #923
Conversation
@@ -279,7 +279,9 @@ void AutoPacket::UpdateSatisfactionUnsafe(std::unique_lock<std::mutex> lk, const | |||
|
|||
// Recursively mark unsatisfiable any single-output arguments on these subscribers: | |||
std::vector<const AutoFilterArgument*> unsatOutputArgs; | |||
auto MarkOutputsUnsat = [&unsatOutputArgs] (const SatCounter& satCounter) { | |||
auto MarkOutputsUnsat = [&unsatOutputArgs] (SatCounter satCounter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, a mistake
@@ -34,7 +34,7 @@ struct SatCounter: | |||
/// </summary> | |||
/// <returns>True if this decrement yielded satisfaction of all arguments</returns> | |||
bool Decrement(void) { | |||
return !--remaining; | |||
return remaining && !--remaining; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like compact logic.
The problem is if an auto filter has multiple inputs marked as unsatisfiable, each time it is marked as unsatisfiable, we call
IncProducerCount
, so the auto filter will become complete prematurely.The fix is to make sure
IncProducerCount
only got called once for each auto filter, only when all its inputs are satisfied or marked as unsatisfiable.