Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Initialize data members with class initializers, or initialization lists.
[simgrid.git] / examples / s4u / dht-kademlia / node.hpp
index 0aa8d80..4004615 100644 (file)
@@ -17,11 +17,11 @@ class Node {
   unsigned int id_;              // node id - 160 bits
   RoutingTable table;            // node routing table
 public:
-  simgrid::s4u::CommPtr receive_comm;
+  simgrid::s4u::CommPtr receive_comm = nullptr;
   void* received_msg             = nullptr;
   unsigned int find_node_success = 0; // Number of find_node which have succeeded.
   unsigned int find_node_failed  = 0; // Number of find_node which have failed.
-  explicit Node(unsigned int node_id) : id_(node_id), table(node_id), receive_comm(nullptr) {}
+  explicit Node(unsigned int node_id) : id_(node_id), table(node_id) {}
   Node(const Node&) = delete;
   Node& operator=(const Node&) = delete;
   unsigned int getId() { return id_; }