aboutsummaryrefslogtreecommitdiff
path: root/src/util/peer.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-10-07 18:19:32 +0000
committerChristian Grothoff <christian@grothoff.org>2012-10-07 18:19:32 +0000
commita60b958f984d08525b636a2c7eae564ebec54ae6 (patch)
tree6dcbbf91d734834f804b2fd9ab790244e2d60e6c /src/util/peer.c
parentdecf459805cdb3f6811f979df4831bc2ce9a2858 (diff)
downloadgnunet-a60b958f984d08525b636a2c7eae564ebec54ae6.tar.gz
gnunet-a60b958f984d08525b636a2c7eae564ebec54ae6.zip
-chaning multihashmap API to allow option for avoiding key allocation
Diffstat (limited to 'src/util/peer.c')
-rw-r--r--src/util/peer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/peer.c b/src/util/peer.c
index 2444cb9f8..a0e965605 100644
--- a/src/util/peer.c
+++ b/src/util/peer.c
@@ -117,7 +117,7 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
117 if (pid == NULL) 117 if (pid == NULL)
118 return 0; 118 return 0;
119 if (NULL == map) 119 if (NULL == map)
120 map = GNUNET_CONTAINER_multihashmap_create (32); 120 map = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES);
121 off = (long) GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey); 121 off = (long) GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey);
122 e = (off == 0) ? NULL : &table[off]; 122 e = (off == 0) ? NULL : &table[off];
123 if (e != NULL) 123 if (e != NULL)
@@ -146,7 +146,7 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
146 table[ret].rc = 1; 146 table[ret].rc = 1;
147 table[ret].pid = ret; 147 table[ret].pid = ret;
148 GNUNET_break (GNUNET_OK == 148 GNUNET_break (GNUNET_OK ==
149 GNUNET_CONTAINER_multihashmap_put (map, &pid->hashPubKey, 149 GNUNET_CONTAINER_multihashmap_put (map, &table[ret].id.hashPubKey,
150 (void *) (long) ret, 150 (void *) (long) ret,
151 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 151 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
152 return ret; 152 return ret;