Browse Source
Merge pull request #2610 from babarosaM33/bloom_reset
ppbloom: save free() and subsequent init() overhead
pull/2611/head
Max Lv
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
3 deletions
-
libbloom
-
src/ppbloom.c
|
|
@ -1 +1 @@ |
|
|
|
Subproject commit 7a9deb893fc1646c0b9186b50d46358379953d4b |
|
|
|
Subproject commit 437e1add5a2b9a87797d8c648df7cf5f3ee155a8 |
|
|
@ -88,8 +88,7 @@ ppbloom_add(const void *buffer, int len) |
|
|
|
if (bloom_count[current] >= entries) { |
|
|
|
bloom_count[current] = 0; |
|
|
|
current = current == PING ? PONG : PING; |
|
|
|
bloom_free(ppbloom + current); |
|
|
|
bloom_init(ppbloom + current, entries, error); |
|
|
|
bloom_reset(ppbloom + current); |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|