aboutsummaryrefslogtreecommitdiff
path: root/src/set/ibf.c
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2013-10-29 17:41:49 +0000
committerFlorian Dold <florian.dold@gmail.com>2013-10-29 17:41:49 +0000
commit3c8f930edb077352ea48fa018a0e80fee0af339d (patch)
tree6395fa9ec45a462a187fd12fde440987507f23ee /src/set/ibf.c
parentf418b3098f441436af78c103a03cd8109f7cc00c (diff)
downloadgnunet-3c8f930edb077352ea48fa018a0e80fee0af339d.tar.gz
gnunet-3c8f930edb077352ea48fa018a0e80fee0af339d.zip
- some of the missing set union functionality implemented
Diffstat (limited to 'src/set/ibf.c')
-rw-r--r--src/set/ibf.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/set/ibf.c b/src/set/ibf.c
index 3b28e15e1..4d40f1f35 100644
--- a/src/set/ibf.c
+++ b/src/set/ibf.c
@@ -134,7 +134,7 @@ ibf_insert_into (struct InvertibleBloomFilter *ibf,
134 134
135 135
136/** 136/**
137 * Insert an element into an IBF. 137 * Insert a key into an IBF.
138 * 138 *
139 * @param ibf the IBF 139 * @param ibf the IBF
140 * @param key the element's hash code 140 * @param key the element's hash code
@@ -148,6 +148,23 @@ ibf_insert (struct InvertibleBloomFilter *ibf, struct IBF_Key key)
148 ibf_insert_into (ibf, key, buckets, 1); 148 ibf_insert_into (ibf, key, buckets, 1);
149} 149}
150 150
151
152/**
153 * Remove a key from an IBF.
154 *
155 * @param ibf the IBF
156 * @param key the element's hash code
157 */
158void
159ibf_remove (struct InvertibleBloomFilter *ibf, struct IBF_Key key)
160{
161 int buckets[ibf->hash_num];
162 GNUNET_assert (ibf->hash_num <= ibf->size);
163 ibf_get_indices (ibf, key, buckets);
164 ibf_insert_into (ibf, key, buckets, -1);
165}
166
167
151/** 168/**
152 * Test is the IBF is empty, i.e. all counts, keys and key hashes are zero. 169 * Test is the IBF is empty, i.e. all counts, keys and key hashes are zero.
153 */ 170 */