1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:38:10 +00:00

LibWeb: Use llround in CSS::Token::to_closest_integer

This should be equivalent, and much shorter than a clamp and static_cast
This commit is contained in:
Hendiadyoin1 2022-03-13 18:50:28 +01:00 committed by Andreas Kling
parent fff12847d5
commit 2f2efc4775

View file

@ -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<i64>(clamp(round(value), NumericLimits<i64>::min(), NumericLimits<i64>::max()));
return llround(value);
}
Type m_type { Type::Invalid };