Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use const& for the parameters of type std::string not affected by previous commit.
[simgrid.git] / teshsuite / simdag / flatifier / flatifier.cpp
index dbb1e71..3140fd4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -35,14 +35,9 @@ static bool parse_cmdline(int* timings, char** platformFile, int argc, char** ar
 
 static void create_environment(xbt_os_timer_t parse_time, const char *platformFile)
 {
-  try {
-    xbt_os_cputimer_start(parse_time);
-    SD_create_environment(platformFile);
-    xbt_os_cputimer_stop(parse_time);
-  }
-  catch (std::exception& e) {
-    xbt_die("Error while loading %s: %s", platformFile, e.what());
-  }
+  xbt_os_cputimer_start(parse_time);
+  SD_create_environment(platformFile);
+  xbt_os_cputimer_stop(parse_time);
 }
 
 static void dump_hosts()
@@ -66,7 +61,7 @@ static void dump_hosts()
     if (not keys.empty()) {
       std::printf(">\n");
       std::sort(keys.begin(), keys.end());
-      for (std::string key : keys)
+      for (const std::string& key : keys)
         std::printf("    <prop id=\"%s\" value=\"%s\"/>\n", key.c_str(), props->at(key).c_str());
       std::printf("  </host>\n");
     } else {