Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / examples / cpp / dht-kademlia / node.cpp
index 4437cc2ede504300c1ae72cb7cc82d59a456cbc7..68d56ebd08bbb3577ee6835d53ca0a1e9f1edc1b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -50,8 +50,7 @@ bool Node::join(unsigned int known_id)
       XBT_DEBUG("Received an answer from the node I know.");
       got_answer = true;
       // retrieve the node list and ping them.
-      const Answer* node_list = msg->answer_.get();
-      if (node_list) {
+      if (const Answer* node_list = msg->answer_.get()) {
         for (auto const& [contact, _] : node_list->getNodes())
           routingTableUpdate(contact);
       } else {