A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
blockers--
[simgrid.git]
/
examples
/
msg
/
dht-kademlia
/
node.c
diff --git
a/examples/msg/dht-kademlia/node.c
b/examples/msg/dht-kademlia/node.c
index
99ee294
..
385d0d6
100644
(file)
--- a/
examples/msg/dht-kademlia/node.c
+++ b/
examples/msg/dht-kademlia/node.c
@@
-115,9
+115,9
@@
unsigned int get_id_in_prefix(unsigned int id, unsigned int prefix)
{
if (prefix == 0) {
return 0;
+ } else {
+ return (1 << (prefix - 1)) ^ id;
}
- unsigned int n = 1 << (prefix - 1);
- return n ^ id;
}
/** @brief Returns the prefix of an identifier.