mirror of https://github.com/AxioDL/boo.git
MIDIDecoder: Make use of std::clamp() within clamp7()
We can simplify the implementation of clamp7() with the use of std::clamp().
This commit is contained in:
parent
e48a094198
commit
e7fe7ff49f
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
namespace boo {
|
namespace boo {
|
||||||
namespace {
|
namespace {
|
||||||
constexpr uint8_t clamp7(uint8_t val) { return std::max(0, std::min(127, int(val))); }
|
constexpr uint8_t clamp7(uint8_t val) { return std::clamp(val, uint8_t{0}, uint8_t{127}); }
|
||||||
|
|
||||||
std::optional<uint32_t> readContinuedValue(std::vector<uint8_t>::const_iterator& it,
|
std::optional<uint32_t> readContinuedValue(std::vector<uint8_t>::const_iterator& it,
|
||||||
std::vector<uint8_t>::const_iterator end) {
|
std::vector<uint8_t>::const_iterator end) {
|
||||||
|
|
Loading…
Reference in New Issue