Fix or filter (#6574)

Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
This commit is contained in:
Jonathan Swoboda 2024-04-22 18:48:30 -04:00 committed by Jesse Hills
parent 44d13f2405
commit 3e64876097
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A
2 changed files with 6 additions and 1 deletions

View file

@ -359,11 +359,15 @@ OrFilter::OrFilter(std::vector<Filter *> filters) : filters_(std::move(filters))
OrFilter::PhiNode::PhiNode(OrFilter *or_parent) : or_parent_(or_parent) {}
optional<float> OrFilter::PhiNode::new_value(float value) {
if (!this->or_parent_->has_value_) {
this->or_parent_->output(value);
this->or_parent_->has_value_ = true;
}
return {};
}
optional<float> OrFilter::new_value(float value) {
this->has_value_ = false;
for (Filter *filter : this->filters_)
filter->input(value);

View file

@ -388,6 +388,7 @@ class OrFilter : public Filter {
};
std::vector<Filter *> filters_;
bool has_value_{false};
PhiNode phi_;
};