Introduce clamp as a template function (#1953)

This commit is contained in:
Stefan Agner
2021-07-14 07:08:18 +02:00
committed by GitHub
parent 08b67e7aea
commit 5cb0c11feb
13 changed files with 17 additions and 14 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ void FanStateCall::perform() const {
}
if (this->speed_.has_value()) {
const int speed_count = this->state_->get_traits().supported_speed_count();
this->state_->speed = static_cast<int>(clamp(*this->speed_, 1, speed_count));
this->state_->speed = clamp(*this->speed_, 1, speed_count);
}
FanStateRTCState saved{};