Skip to content

Commit

Permalink
visualizer: Use reserve not resize for keyframes vector in msg_info
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikmohta committed Feb 19, 2016
1 parent 35a137c commit 245547d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion svo_ros/src/visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void Visualizer::publishMinimal(
svo_msgs::Info msg_info;
msg_info.header = header_msg;
msg_info.processing_time = slam.lastProcessingTime();
msg_info.keyframes.resize(slam.map().keyframes_.size());
msg_info.keyframes.reserve(slam.map().keyframes_.size());
for(list<FramePtr>::const_iterator it=slam.map().keyframes_.begin(); it!=slam.map().keyframes_.end(); ++it)
msg_info.keyframes.push_back((*it)->id_);
msg_info.stage = static_cast<int>(slam.stage());
Expand Down

0 comments on commit 245547d

Please sign in to comment.