mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-18 16:16:52 +00:00
Fixed bug, clear the next filter instead of the current one
This commit is contained in:
+4
-3
@@ -85,11 +85,12 @@ impl PingPongBloom {
|
||||
|
||||
if self.bloom_count[self.current] >= self.item_count {
|
||||
// Current bloom filter is full,
|
||||
// Create a new one and use the next one as current.
|
||||
self.bloom_count[self.current] = 0;
|
||||
self.blooms[self.current].clear();
|
||||
// Create a new one and use that one as current.
|
||||
|
||||
self.current = (self.current + 1) % 2;
|
||||
|
||||
self.bloom_count[self.current] = 0;
|
||||
self.blooms[self.current].clear();
|
||||
}
|
||||
|
||||
// Cannot be optimized by `check_and_set`
|
||||
|
||||
Reference in New Issue
Block a user