Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar smells after last changes.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 27 Jan 2023 15:17:35 +0000 (16:17 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 27 Jan 2023 15:17:35 +0000 (16:17 +0100)
src/kernel/routing/ClusterZone.cpp
teshsuite/s4u/actor-suspend/actor-suspend.cpp

index cce4063..bb269eb 100644 (file)
@@ -69,7 +69,9 @@ void ClusterBase::fill_leaf_from_cb(unsigned long position, const std::vector<un
   // auxiliary function to get dims from index
   auto index_to_dims = [&dimensions](unsigned long index) {
     std::vector<unsigned long> dims_array(dimensions.size());
-    for (auto i = static_cast<int>(dimensions.size() - 1); i >= 0 && index > 0; --i) {
+    for (auto i = static_cast<int>(dimensions.size() - 1); i >= 0; --i) {
+      if (index == 0)
+        break;
       unsigned long value = index % dimensions[i];
       dims_array[i]      = value;
       index              = (index / dimensions[i]);
index f7f795d..ed4d1ed 100644 (file)
@@ -29,7 +29,7 @@ class Suspender {
   const simgrid::s4u::ActorPtr& receiver;
 
 public:
-  Suspender(simgrid::s4u::ActorPtr& receiver) : receiver(receiver) {}
+  explicit Suspender(const simgrid::s4u::ActorPtr& receiver) : receiver(receiver) {}
 
   void operator()() const
   {