Skip to content

Commit

Permalink
bloom: allow to pass in whether to set bits for strings
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Sep 25, 2016
1 parent 0a301e9 commit eb50727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/bloom.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords)
return __bloom_check(b, data, nwords * sizeof(uint32_t), true);
}

bool bloom_set_string(struct bloom *b, const char *data, unsigned int len)
bool bloom_string(struct bloom *b, const char *data, unsigned int len,
bool set)
{
return __bloom_check(b, data, len, true);
return __bloom_check(b, data, len, set);
}
2 changes: 1 addition & 1 deletion lib/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ struct bloom;
struct bloom *bloom_new(uint64_t entries);
void bloom_free(struct bloom *b);
bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords);
bool bloom_set_string(struct bloom *b, const char *data, unsigned int len);
bool bloom_string(struct bloom *b, const char *data, unsigned int len, bool);

#endif

0 comments on commit eb50727

Please sign in to comment.