@@ -75,14 +75,14 @@ class gz::sim::SystemLoaderPrivate
7575 << " ]. Using [" << filename << " ] instead." << std::endl;
7676 }
7777
78- std::list<std::string> paths = this ->PluginPaths ();
78+ const std::list<std::string> paths = this ->PluginPaths ();
7979 common::SystemPaths systemPaths;
8080 for (const auto &p : paths)
8181 {
8282 systemPaths.AddPluginPaths (p);
8383 }
8484
85- auto pathToLib = systemPaths.FindSharedLibrary (filename);
85+ const auto pathToLib = systemPaths.FindSharedLibrary (filename);
8686 if (pathToLib.empty ())
8787 {
8888 // We assume gz::sim corresponds to the levels feature
@@ -94,7 +94,7 @@ class gz::sim::SystemLoaderPrivate
9494 return false ;
9595 }
9696
97- auto pluginNames = this ->loader .LoadLib (pathToLib, true );
97+ const auto pluginNames = this ->loader .LoadLib (pathToLib, true );
9898 if (pluginNames.empty ())
9999 {
100100 std::stringstream ss;
@@ -107,7 +107,7 @@ class gz::sim::SystemLoaderPrivate
107107 return false ;
108108 }
109109
110- auto pluginName = *pluginNames.begin ();
110+ const auto & pluginName = *pluginNames.begin ();
111111 if (pluginName.empty ())
112112 {
113113 std::stringstream ss;
@@ -200,7 +200,7 @@ class gz::sim::SystemLoaderPrivate
200200 // Default plugin search path environment variable
201201 public: std::string pluginPathEnv{" GZ_SIM_SYSTEM_PLUGIN_PATH" };
202202
203- // / \brief Plugin loader instace
203+ // / \brief Plugin loader instance
204204 public: gz::plugin::Loader loader;
205205
206206 // / \brief Paths to search for system plugins.
@@ -232,7 +232,7 @@ void SystemLoader::AddSystemPluginPath(const std::string &_path)
232232std::optional<SystemPluginPtr> SystemLoader::LoadPlugin (
233233 const sdf::Plugin &_plugin)
234234{
235- if (_plugin.Filename () == " " )
235+ if (_plugin.Filename (). empty () )
236236 {
237237 gzerr << " Failed to instantiate system plugin: empty argument "
238238 " [(filename): " << _plugin.Filename () << " ] " << std::endl;
0 commit comments