File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -139,15 +139,7 @@ namespace etl
139
139
// *************************************************************************
140
140
void set (T value_)
141
141
{
142
- if (value_ > Last)
143
- {
144
- value_ = Last;
145
- }
146
-
147
- // lower-bound clamp only if First != 0
148
- detail::lower_bound_impl<(First != 0 ), T, First>::apply (value_);
149
-
150
- value = value_;
142
+ value = etl::clamp (value_, First, Last);
151
143
}
152
144
153
145
// *************************************************************************
@@ -427,16 +419,7 @@ namespace etl
427
419
// *************************************************************************
428
420
void set (T value_)
429
421
{
430
- if (value_ > last_value)
431
- {
432
- value_ = last_value;
433
- }
434
- else if (value_ < first_value)
435
- {
436
- value_ = first_value;
437
- }
438
-
439
- value = value_;
422
+ value = etl::clamp (value_, first_value, last_value);
440
423
}
441
424
442
425
// *************************************************************************
You can’t perform that action at this time.
0 commit comments