Commit 3153252 1 parent f13503a commit 3153252 Copy full SHA for 3153252
File tree 1 file changed +7
-4
lines changed
perception/autoware_compare_map_segmentation/src/voxel_grid_map_loader
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -207,10 +207,13 @@ class VoxelGridDynamicMapLoader : public VoxelGridMapLoader
207
207
}
208
208
inline std::vector<std::string> getCurrentMapIDs ()
209
209
{
210
- std::vector<std::string> current_map_ids{};
211
- std::lock_guard<std::mutex> lock (dynamic_map_loader_mutex_);
212
- for (auto & kv : current_voxel_grid_dict_) {
213
- current_map_ids.push_back (kv.first );
210
+ std::vector<std::string> current_map_ids;
211
+ {
212
+ std::lock_guard<std::mutex> lock (dynamic_map_loader_mutex_);
213
+ current_map_ids.reserve (current_voxel_grid_dict_.size ());
214
+ for (const auto & kv : current_voxel_grid_dict_) {
215
+ current_map_ids.push_back (kv.first );
216
+ }
214
217
}
215
218
return current_map_ids;
216
219
}
You can’t perform that action at this time.
0 commit comments