mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 19:23:28 +02:00
PR feedback
This commit is contained in:
parent
abbfe15395
commit
0e13348b5a
1 changed files with 4 additions and 9 deletions
|
@ -28,23 +28,18 @@ AnyEndpoint::AnyEndpoint(Endpoint::List children) : Endpoint(Input::INVALID_INPU
|
|||
}
|
||||
|
||||
float AnyEndpoint::peek() const {
|
||||
float result = 0;
|
||||
for (auto& child : _children) {
|
||||
float childResult = child->peek();
|
||||
if (childResult != 0.0f) {
|
||||
return childResult;
|
||||
}
|
||||
result = std::max(result, child->peek());
|
||||
}
|
||||
return 0.0f;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Fetching the value must trigger any necessary side effects of value() on ALL the children.
|
||||
float AnyEndpoint::value() {
|
||||
float result = 0;
|
||||
for (auto& child : _children) {
|
||||
float childResult = child->value();
|
||||
if (childResult != 0.0f) {
|
||||
result = childResult;
|
||||
}
|
||||
result = std::max(result, child->value());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue