]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/routing/TorusZone.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Reduce number of 'break' in loop.
[simgrid.git] / src / kernel / routing / TorusZone.cpp
index 6323da97785d0efd8ff7528aff87f9f39628af31..ac9177edc53dfbc2620873ae53e300fc19f6c89f 100644 (file)
@@ -107,8 +107,8 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
    * both arrays, we can easily assess whether we need to route into this dimension or not.
    */
   const unsigned int dsize = dimensions_.size();
-  auto* myCoords                = new unsigned int[dsize];
-  auto* targetCoords            = new unsigned int[dsize];
+  std::vector<unsigned int> myCoords(dsize);
+  std::vector<unsigned int> targetCoords(dsize);
   unsigned int dim_size_product = 1;
   for (unsigned i = 0; i < dsize; i++) {
     unsigned cur_dim_size = dimensions_[i];
@@ -185,8 +185,6 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
 
     current_node = next_node;
   }
-  delete[] myCoords;
-  delete[] targetCoords;
 }
 } // namespace routing
 } // namespace kernel