Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use the init-statement to declare variables inside the if statement (sonar).
[simgrid.git] / examples / cpp / clusters-multicpu / s4u-clusters-multicpu.cpp
index ec75a90..8ae7a7a 100644 (file)
@@ -293,10 +293,9 @@ static void create_dragonfly_cluster()
 int main(int argc, char* argv[])
 {
   sg4::Engine e(&argc, argv);
-  std::string platform = argv[1];
 
   /* create platform */
-  if (platform == "torus")
+  if (std::string platform(argv[1]); platform == "torus")
     create_torus_cluster();
   else if (platform == "fatTree")
     create_fatTree_cluster();