Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid unnecessary copy by using a 'const' reference (sonar).
[simgrid.git] / src / xbt / xbt_parse_units.cpp
index 7321a37..7bdcbf9 100644 (file)
@@ -120,7 +120,7 @@ std::vector<double> xbt_parse_get_bandwidths(const std::string& filename, int li
   std::vector<double> bandwidths;
   std::vector<std::string> tokens;
   boost::split(tokens, string, boost::is_any_of(";,"));
-  for (auto token : tokens) {
+  for (auto const& token : tokens) {
     bandwidths.push_back(surf_parse_get_value_with_unit(
         filename, lineno, token.c_str(), units, entity_kind, name,
         "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps"));