From 3b9a048291bd9edeb69cb8c074ac3cbba3744531 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 21 Dec 2021 18:23:39 -0800 Subject: [PATCH] SW/Tev: Use std::clamp for Clamp255 and Clamp1024 --- Source/Core/VideoBackends/Software/Tev.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 6dd3a2aa56..f1fecdab40 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -29,12 +29,12 @@ static inline s16 Clamp255(s16 in) { - return in > 255 ? 255 : (in < 0 ? 0 : in); + return std::clamp(in, 0, 255); } static inline s16 Clamp1024(s16 in) { - return in > 1023 ? 1023 : (in < -1024 ? -1024 : in); + return std::clamp(in, -1024, 1023); } void Tev::SetRasColor(RasColorChan colorChan, int swaptable)