mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibGfx: Use VectorN dot product of self for length()
No functional changes.
This commit is contained in:
committed by
Linus Groh
parent
582fb3f263
commit
dfe002cfd4
@@ -201,11 +201,7 @@ public:
|
||||
|
||||
[[nodiscard]] constexpr T length() const
|
||||
{
|
||||
T squared_sum {};
|
||||
UNROLL_LOOP
|
||||
for (auto i = 0u; i < N; ++i)
|
||||
squared_sum += m_data[i] * m_data[i];
|
||||
return AK::sqrt(squared_sum);
|
||||
return AK::sqrt(dot(*this));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr VectorN<2, T> xy() const requires(N >= 3)
|
||||
|
||||
Reference in New Issue
Block a user