Skip to content

Commit

Permalink
consolidated initialization for loops
Browse files Browse the repository at this point in the history
Signed-off-by: alexander <[email protected]>
  • Loading branch information
alexanderjyuen committed Dec 7, 2024
1 parent 822bf1f commit 58e26e4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions nav2_costmap_2d/plugins/plugin_container_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,10 @@ void PluginContainerLayer::onInitialize()
this,
std::placeholders::_1));


plugin_types_.resize(plugin_names_.size());

for (size_t i = 0; i < plugin_names_.size(); ++i) {
plugin_types_[i] = nav2_util::get_plugin_type_param(node, name_ + "." + plugin_names_[i]);
}

// Then load and add the plug-ins to the costmap
for (unsigned int i = 0; i < plugin_names_.size(); ++i) {
plugin_types_[i] = nav2_util::get_plugin_type_param(node, name_ + "." + plugin_names_[i]);
std::shared_ptr<Layer> plugin = plugin_loader_.createSharedInstance(plugin_types_[i]);
addPlugin(plugin, plugin_names_[i]);
}
Expand Down

0 comments on commit 58e26e4

Please sign in to comment.