Replace (std::min + std::max) with std::clamp

Replace (std::min + std::max) with std::clamp
This commit is contained in:
Kelsi Rae Davis 2026-03-09 18:34:14 -07:00 committed by GitHub
commit 2afd455d52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@
#include "audio/audio_engine.hpp"
#include "pipeline/asset_manager.hpp"
#include "core/logger.hpp"
#include <algorithm>
#include <random>
namespace wowee {
@ -180,7 +181,7 @@ void SpellSoundManager::playRandomSound(const std::vector<SpellSample>& library,
}
void SpellSoundManager::setVolumeScale(float scale) {
volumeScale_ = std::max(0.0f, std::min(1.0f, scale));
volumeScale_ = std::clamp(scale, .0f, 1.f);
}
void SpellSoundManager::playPrecast(MagicSchool school, SpellPower power) {