Skip to content

Commit

Permalink
Remove unnecessary copy in deep copy
Browse files Browse the repository at this point in the history
  • Loading branch information
mandi1267 committed Dec 7, 2023
1 parent f6b79c4 commit 95809f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ struct RobotPoseNode {
: pose_(std::make_shared<RawPose3d<double>>(pose)) {}

RobotPoseNode makeDeepCopy() const {
RawPose3d<double> pose_copy(*pose_);
return RobotPoseNode(pose_copy);
return RobotPoseNode(*pose_);
}

void updateRobotPoseParams(const RawPose3d<double> &pose) {
Expand All @@ -55,8 +54,7 @@ struct VisualFeatureNode {
: position_(std::make_shared<Position3d<double>>(position)) {}

VisualFeatureNode makeDeepCopy() const {
Position3d<double> position_copy(*position_);
return VisualFeatureNode(position_copy);
return VisualFeatureNode(*position_);
}

void updateVisualPositionParams(const Position3d<double> &position) {
Expand Down
3 changes: 1 addition & 2 deletions include/refactoring/optimization/object_pose_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ void updateEllipsoidParams(const RawEllipsoidPtr<double> &ellipsoid_ptr) {
}

EllipsoidEstimateNode makeDeepCopy() const {
RawEllipsoid<double> ellipsoid_copy(*ellipsoid_);
return EllipsoidEstimateNode(ellipsoid_copy);
return EllipsoidEstimateNode(*ellipsoid_);
}
}; // namespace vslam_types_refactor

Expand Down

0 comments on commit 95809f3

Please sign in to comment.