Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace redundant type with "auto" (examples/).
[simgrid.git] / examples / s4u / mc-bugged1 / s4u-mc-bugged1.cpp
index 802403d..e642594 100644 (file)
@@ -11,7 +11,7 @@
 #include <simgrid/modelchecker.h>
 #include <simgrid/s4u.hpp>
 
-#define N 3
+constexpr int N = 3;
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
@@ -35,8 +35,7 @@ static void server()
 
 static void client(int id)
 {
-  int* payload = new int();
-  *payload     = id;
+  auto* payload = new int(id);
   simgrid::s4u::Mailbox::by_name("mymailbox")->put(payload, 10000);
 
   XBT_INFO("Sent!");