Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the release date in the release notes
[simgrid.git] / src / xbt / xbt_parse_units.cpp
index 01066f2f1cea93e783e65289c8ad7c9ad3e2e163..60d884371fb893d30a8e9f93736a8f342bdd0438 100644 (file)
@@ -1,3 +1,8 @@
+/* Copyright (c) 2007-2022. 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. */
+
 #include "simgrid/Exception.hpp"
 #include "xbt/ex.h"
 #include "xbt/log.h"
@@ -141,19 +146,15 @@ std::vector<double> xbt_parse_get_all_speeds(const std::string& filename, int li
                                              const std::string& entity_kind)
 {
   std::vector<double> speed_per_pstate;
+  std::vector<std::string> pstate_list;
 
-  if (speeds.find('.') == std::string::npos) {
-    double speed = xbt_parse_get_speed(filename, lineno, speeds, entity_kind);
+  boost::split(pstate_list, speeds, boost::is_any_of(","));
+  for (auto speed_str : pstate_list) {
+    boost::trim(speed_str);
+    double speed = xbt_parse_get_speed(filename, lineno, speed_str, entity_kind);
     speed_per_pstate.push_back(speed);
-  } else {
-    std::vector<std::string> pstate_list;
-    boost::split(pstate_list, speeds, boost::is_any_of(","));
-    for (auto speed_str : pstate_list) {
-      boost::trim(speed_str);
-      double speed = xbt_parse_get_speed(filename, lineno, speed_str, entity_kind);
-      speed_per_pstate.push_back(speed);
-      XBT_DEBUG("Speed value: %f", speed);
-    }
+    XBT_DEBUG("Speed value: %f", speed);
   }
+
   return speed_per_pstate;
 }