Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Minor Sonar smells.
[simgrid.git] / src / s4u / s4u_Host.cpp
index 39fbe16..72dcc0f 100644 (file)
@@ -319,13 +319,14 @@ Disk* Host::create_disk(const std::string& name, double read_bandwidth, double w
 
 Disk* Host::create_disk(const std::string& name, const std::string& read_bandwidth, const std::string& write_bandwidth)
 {
-  double d_read, d_write;
+  double d_read;
   try {
     d_read = xbt_parse_get_bandwidth("", 0, read_bandwidth.c_str(), nullptr, "");
   } catch (const simgrid::ParseError&) {
     throw std::invalid_argument(std::string("Impossible to create disk: ") + name +
                                 std::string(". Invalid read bandwidth: ") + read_bandwidth);
   }
+  double d_write;
   try {
     d_write = xbt_parse_get_bandwidth("", 0, write_bandwidth.c_str(), nullptr, "");
   } catch (const simgrid::ParseError&) {