diff --git a/src/context.rs b/src/context.rs index 8021349b..40f06f58 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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`