| 11628 | |
| 11629 | |
| 11630 | static void setLimit(Option<Value::Scalar>& limit, const Value::Scalar& delta) |
| 11631 | { |
| 11632 | if (limit.isSome() && std::isinf(limit->value())) { |
| 11633 | // Just return if the limit is already infinite. |
| 11634 | return; |
| 11635 | } |
| 11636 | |
| 11637 | Value::Scalar scalar; |
| 11638 | if (limit.isNone() || std::isinf(delta.value())) { |
| 11639 | // Set limit directly if it is the first time or the value to be |
| 11640 | // added is infinite. |
| 11641 | scalar.set_value(delta.value()); |
| 11642 | } else { |
| 11643 | // Add the value into the limit. |
| 11644 | scalar.set_value(limit->value() + delta.value()); |
| 11645 | } |
| 11646 | |
| 11647 | limit = scalar; |
| 11648 | }; |
| 11649 | |
| 11650 | } // namespace slave { |
| 11651 | } // namespace internal { |
no test coverage detected