Skip to content

Commit ef6c868

Browse files
Levi ArmstrongLevi-Armstrong
authored andcommitted
Remove use of new operator
1 parent 4549718 commit ef6c868

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tesseract/tesseract_environment/src/kdl/kdl_state_solver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void KDLStateSolver::setState(const std::vector<std::string>& joint_names,
106106

107107
EnvState::Ptr KDLStateSolver::getState(const std::unordered_map<std::string, double>& joints) const
108108
{
109-
EnvState::Ptr state(new EnvState(*current_state_));
109+
EnvState::Ptr state{ std::make_shared<EnvState>(*current_state_) };
110110
KDL::JntArray jnt_array = kdl_jnt_array_;
111111

112112
for (auto& joint : joints)
@@ -125,7 +125,7 @@ EnvState::Ptr KDLStateSolver::getState(const std::unordered_map<std::string, dou
125125
EnvState::Ptr KDLStateSolver::getState(const std::vector<std::string>& joint_names,
126126
const std::vector<double>& joint_values) const
127127
{
128-
EnvState::Ptr state(new EnvState(*current_state_));
128+
EnvState::Ptr state{ std::make_shared<EnvState>(*current_state_) };
129129
KDL::JntArray jnt_array = kdl_jnt_array_;
130130

131131
for (auto i = 0u; i < joint_names.size(); ++i)
@@ -144,7 +144,7 @@ EnvState::Ptr KDLStateSolver::getState(const std::vector<std::string>& joint_nam
144144
EnvState::Ptr KDLStateSolver::getState(const std::vector<std::string>& joint_names,
145145
const Eigen::Ref<const Eigen::VectorXd>& joint_values) const
146146
{
147-
EnvState::Ptr state(new EnvState(*current_state_));
147+
EnvState::Ptr state{ std::make_shared<EnvState>(*current_state_) };
148148
KDL::JntArray jnt_array = kdl_jnt_array_;
149149

150150
for (auto i = 0u; i < joint_names.size(); ++i)

tesseract/tesseract_kinematics/include/tesseract_kinematics/core/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ createKinematicsMap(const tesseract_scene_graph::SceneGraph::ConstPtr& scene_gra
234234
{
235235
if (manipulators.find(group.first) == manipulators.end())
236236
{
237-
std::shared_ptr<Chain_T> manip(new Chain_T());
237+
std::shared_ptr<Chain_T> manip{ std::make_shared<Chain_T>() };
238238
if (!manip->init(scene_graph, group.second, group.first))
239239
{
240240
CONSOLE_BRIDGE_logError("Failed to create kinematic chaing for manipulator %s!", group.first);
@@ -253,7 +253,7 @@ createKinematicsMap(const tesseract_scene_graph::SceneGraph::ConstPtr& scene_gra
253253
{
254254
if (manipulators.find(group.first) == manipulators.end())
255255
{
256-
std::shared_ptr<Tree_T> manip(new Tree_T());
256+
std::shared_ptr<Tree_T> manip{ std::make_shared<Tree_T>() };
257257
if (!manip->init(scene_graph, group.second, group.first))
258258
{
259259
CONSOLE_BRIDGE_logError("Failed to create kinematic chaing for manipulator %s!", group.first);

0 commit comments

Comments
 (0)