diff options
author | Hans Goudey <h.goudey@me.com> | 2021-05-19 20:02:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-05-19 20:02:53 +0300 |
commit | 192a3f1a05d00f1f10f32861c098b66f78cff3e4 (patch) | |
tree | 479224c98f48754e47dd2940cbb460af5a5eed4d /source/blender/blenkernel/intern/geometry_component_curve.cc | |
parent | 330fecc9b7f69c11258ea926ce760e51b4f3dd78 (diff) |
Cleanup: Use copy constructor for CurveEval
There is no need for a special "copy" method with a copy constructor,
which will be necessary to explicitly copy attributes anyway.
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curve.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index 44c5cce92dd..d6c7cae2727 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -39,7 +39,7 @@ GeometryComponent *CurveComponent::copy() const { CurveComponent *new_component = new CurveComponent(); if (curve_ != nullptr) { - new_component->curve_ = curve_->copy(); + new_component->curve_ = new CurveEval(*curve_); new_component->ownership_ = GeometryOwnershipType::Owned; } return new_component; @@ -87,7 +87,7 @@ CurveEval *CurveComponent::get_for_write() { BLI_assert(this->is_mutable()); if (ownership_ == GeometryOwnershipType::ReadOnly) { - curve_ = curve_->copy(); + curve_ = new CurveEval(*curve_); ownership_ = GeometryOwnershipType::Owned; } return curve_; @@ -107,7 +107,7 @@ void CurveComponent::ensure_owns_direct_data() { BLI_assert(this->is_mutable()); if (ownership_ != GeometryOwnershipType::Owned) { - curve_ = curve_->copy(); + curve_ = new CurveEval(*curve_); ownership_ = GeometryOwnershipType::Owned; } } |