Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't tell 165 times that we need CMAKE v2.6
[simgrid.git] / examples / msg / kademlia / routing_table.c
index 022a986..3501868 100644 (file)
@@ -1,11 +1,12 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2015. 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. */
+
 #include "routing_table.h"
 #include "node.h"
-#include "msg/msg.h"
+#include "simgrid/msg.h"
 #include "xbt/log.h"
 #include "xbt/asserts.h"
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_kademlia_routing_table,
@@ -58,7 +59,7 @@ void routing_table_print(routing_table_t table)
   XBT_INFO("Routing table of %08x:", table->id);
 
   for (i = 0; i <= identifier_size; i++) {
-    if (xbt_dynar_length(table->buckets[i].nodes) > 0) {
+    if (!xbt_dynar_is_empty(table->buckets[i].nodes)) {
       XBT_INFO("Bucket number %d: ", i);
       xbt_dynar_foreach(table->buckets[i].nodes, j, value) {
         XBT_INFO("Element %d: %08x", j, value);