Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Correct a few a/an.
[simgrid.git] / examples / s4u / dht-kademlia / answer.cpp
index 7fa8655..bbe546c 100644 (file)
@@ -10,8 +10,8 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(kademlia_node);
 
 namespace kademlia {
 
-/** @brief Prints a answer_t, for debugging purposes */
-void Answer::print()
+/** @brief Prints an Answer, for debugging purposes */
+void Answer::print() const
 {
   XBT_INFO("Searching %08x, size %zu", destination_id_, nodes_.size());
   unsigned int i = 0;
@@ -58,16 +58,16 @@ bool Answer::destinationFound() const
   return not nodes_.empty() && nodes_.begin()->second == 0;
 }
 
-/** @brief Adds the content of a bucket unsigned into a answer object.
 * @param bucket the bucket we have to had unsigned into
 */
+/** @brief Adds the content of a bucket unsigned into an answer object.
+ * @param bucket the bucket we have to had unsigned into
+ */
 void Answer::addBucket(const Bucket* bucket)
 {
   xbt_assert((bucket != nullptr), "Provided a NULL bucket");
 
-  for (auto const& id : bucket->nodes) {
+  for (auto const& id : bucket->nodes_) {
     unsigned int distance = id ^ destination_id_;
-    nodes_.push_back(std::pair<unsigned int, unsigned int>(id, distance));
+    nodes_.emplace_back(id, distance);
   }
 }
-}
+} // namespace kademlia