Skip to content

Commit

Permalink
Remove an unnecessary optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Sep 21, 2024
1 parent 4bfd256 commit a2a7e26
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions common/vecmat.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ class Vector {
mVals[2] - rhs.mVals[2], mVals[3] - rhs.mVals[3]};
}

constexpr auto normalize(float limit = std::numeric_limits<float>::epsilon()) -> float
constexpr auto normalize() -> float
{
limit = std::max(limit, std::numeric_limits<float>::epsilon());
const auto length_sqr = float{mVals[0]*mVals[0] + mVals[1]*mVals[1] + mVals[2]*mVals[2]};
if(length_sqr > limit*limit)
if(length_sqr > std::numeric_limits<float>::epsilon())
{
const auto length = float{std::sqrt(length_sqr)};
auto inv_length = float{1.0f / length};
Expand Down

0 comments on commit a2a7e26

Please sign in to comment.