From d494059164ef1ac47c1efc899cd2c571e42ef6a0 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Fri, 31 May 2024 23:08:05 -0500 Subject: [PATCH] Common: update json util function for converting to numeric value to use a static_cast. As discussed, a Saturating cast doesn't make sense when converting a double to a float --- Source/Core/Common/JsonUtil.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/Common/JsonUtil.h b/Source/Core/Common/JsonUtil.h index 309f32f4b4..c830d777a4 100644 --- a/Source/Core/Common/JsonUtil.h +++ b/Source/Core/Common/JsonUtil.h @@ -9,7 +9,6 @@ #include -#include "Common/MathUtil.h" #include "Common/Matrix.h" // Ideally this would use a concept like, 'template ' to constrain it, @@ -47,7 +46,7 @@ std::optional ReadNumericFromJson(const picojson::object& obj, const std:: return std::nullopt; if (!it->second.is()) return std::nullopt; - return MathUtil::SaturatingCast(it->second.get()); + return static_cast(it->second.get()); } std::optional ReadStringFromJson(const picojson::object& obj, const std::string& key);