Skip to content

Commit

Permalink
Use memcpy instead of std::copy
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero committed Jun 24, 2024
1 parent 4c64bbe commit 65ac635
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ros_gz_bridge/src/convert/sensor_msgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ convert_gz_to_ros(

auto count = ros_msg.step * ros_msg.height;
ros_msg.data.resize(ros_msg.step * ros_msg.height);
std::copy(
gz_msg.data().begin(),
gz_msg.data().begin() + count,
ros_msg.data.begin());
memcpy(ros_msg.data.data(), gz_msg.data().c_str(), gz_msg.data().size());
}

template<>
Expand Down

0 comments on commit 65ac635

Please sign in to comment.