3 ms·
Rust does this as well with iterators and iterator adapters -- I just forgot to include the version that did so in the blog post. Writing a loop like this:
by dikaiosune 10y ago
Rust does this as well with iterators and iterator adapters -- I just forgot to include the version that did so in the blog post. Writing a loop like this:
let mut count = 0;
for b in &bwt[(i * self.k) + 1 .. r + 1] {
if b == a {
count += 1;
}
}
Gave me similar performance to the filter/count iterators, as both elide bounds checking. I thought I mentioned that in the parting thoughts, but I may be misremembering and I have to run.