Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lambdas should not have too many lines (sonar).
[simgrid.git] / src / plugins / host_dvfs.cpp
index 0404ae069ff3da2c91d7015b2b44a2a549a3164a..9245029d2186e17b9d9dbc3a758da2119a346ddd 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 
 #include <boost/algorithm/string.hpp>
+#include <string_view>
 
 SIMGRID_REGISTER_PLUGIN(host_dvfs, "Dvfs support", &sg_host_dvfs_plugin_init)
 
@@ -43,7 +44,7 @@ static simgrid::config::Flag<std::string> cfg_governor("plugin/dvfs/governor",
                                                              {"performance", "TODO: Doc"}, {"powersave", "TODO: Doc"},
                                                        }),
 
-                                                       [](const std::string& val) {
+                                                       [](std::string_view val) {
                                                          if (val != "performance")
                                                            sg_host_dvfs_plugin_init();
                                                        });
@@ -65,10 +66,7 @@ static simgrid::config::Flag<int>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host_dvfs, kernel, "Logging specific to the HostDvfs plugin");
 
-namespace simgrid {
-namespace plugin {
-
-namespace dvfs {
+namespace simgrid::plugin::dvfs {
 
 /**
  *  Add this to your host tag:
@@ -360,9 +358,7 @@ public:
   void update() override {}
 };
 #endif
-} // namespace dvfs
-} // namespace plugin
-} // namespace simgrid
+} // namespace simgrid::plugin::dvfs
 
 /* **************************** events  callback *************************** */
 static void on_host_added(simgrid::s4u::Host& host)