Rust implementation of the CVM algorithm for counting distinct elements in a stream
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1 from kuldeepmeel/main

+1 -4
+1 -4
src/lib.rs
··· 51 51 if self.rng.gen_bool(self.probability) { 52 52 self.buf.push(clean_word); 53 53 } 54 - if self.buf.len() == self.buf_size { 54 + while self.buf.len() == self.buf_size { 55 55 self.clear_about_half(); 56 56 self.probability /= 2.0; 57 - if self.buf.len() == self.buf_size { 58 - panic!("Something has gone proper wrong") 59 - } 60 57 } 61 58 } 62 59 }