From 2f2efc47755500635fbf8b7218e66391ff37d388 Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Sun, 13 Mar 2022 18:50:28 +0100 Subject: [PATCH] LibWeb: Use llround in CSS::Token::to_closest_integer This should be equivalent, and much shorter than a clamp and static_cast --- Userland/Libraries/LibWeb/CSS/Parser/Token.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Token.h b/Userland/Libraries/LibWeb/CSS/Parser/Token.h index 6a29d7b37a..c509a9672d 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Token.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Token.h @@ -171,7 +171,7 @@ private: // When a value cannot be explicitly supported due to range/precision limitations, it must be converted // to the closest value supported by the implementation, but how the implementation defines "closest" // is explicitly undefined as well. - return static_cast(clamp(round(value), NumericLimits::min(), NumericLimits::max())); + return llround(value); } Type m_type { Type::Invalid };