-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2014. 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 "answer.h"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg_kademlia_node);
{
node_contact_t c1 = *(void **) e1;
node_contact_t c2 = *(void **) e2;
- return c1->distance >= c2->distance;
+ if (c1->distance == c2->distance)
+ return 0;
+ else
+ if (c1->distance < c2->distance)
+ return -1;
+ else
+ return 1;
}
/**