From 11ee78f88bb811a8998b2dc7499c003289a24b1f Mon Sep 17 00:00:00 2001 From: Felix Dick Date: Wed, 28 Sep 2022 19:43:35 +0200 Subject: Use double literals, don't cast a integer literal to double. --- src/helpers/MiscFunctions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helpers/MiscFunctions.cpp') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index b2f3a086..17e7a1a1 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -286,7 +286,7 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) { if (PWORKSPACE) result = PWORKSPACE->m_iID; } - + outName = std::to_string(result); } } @@ -295,8 +295,8 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) { } float vecToRectDistanceSquared(const Vector2D& vec, const Vector2D& p1, const Vector2D& p2) { - const float DX = std::max((double)0, std::max(p1.x - vec.x, vec.x - p2.x)); - const float DY = std::max((double)0, std::max(p1.y - vec.y, vec.y - p2.y)); + const float DX = std::max({0.0, p1.x - vec.x, vec.x - p2.x}); + const float DY = std::max({0.0, p1.y - vec.y, vec.y - p2.y}); return DX * DX + DY * DY; } -- cgit v1.2.3