diff options
author | Hans Goudey <h.goudey@me.com> | 2021-08-02 22:45:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-08-02 22:45:25 +0300 |
commit | efd7c95bb27ccee31a34de03f15ad9542d19f7da (patch) | |
tree | 846f66cc887e96d490d4ebdd8d40960033c45043 /source/blender/blenkernel | |
parent | a4813379f9ce26862d826cfc98d1f28e0bbe11d7 (diff) |
Cleanup: Remove duplicate special case check
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/spline_base.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/spline_base.cc b/source/blender/blenkernel/intern/spline_base.cc index 987152f34bc..dda7abea0fc 100644 --- a/source/blender/blenkernel/intern/spline_base.cc +++ b/source/blender/blenkernel/intern/spline_base.cc @@ -201,6 +201,7 @@ static void calculate_tangents(Span<float3> positions, MutableSpan<float3> tangents) { if (positions.size() == 1) { + tangents.first() = float3(0.0f, 0.0f, 1.0f); return; } @@ -241,13 +242,8 @@ Span<float3> Spline::evaluated_tangents() const Span<float3> positions = this->evaluated_positions(); - if (eval_size == 1) { - evaluated_tangents_cache_.first() = float3(1.0f, 0.0f, 0.0f); - } - else { - calculate_tangents(positions, is_cyclic_, evaluated_tangents_cache_); - this->correct_end_tangents(); - } + calculate_tangents(positions, is_cyclic_, evaluated_tangents_cache_); + this->correct_end_tangents(); tangent_cache_dirty_ = false; return evaluated_tangents_cache_; |