Skip to content

Commit

Permalink
geo_filters: Remove dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
gorzell committed May 13, 2024
1 parent 2bb9a0f commit fa0b732
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions crates/geo_filters/src/diff_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use std::borrow::Cow;
use std::cmp::Ordering;
use std::iter::Peekable;
use std::mem::{size_of, size_of_val};

use crate::config::{
Expand Down Expand Up @@ -346,29 +345,6 @@ impl<C: GeoConfig<Diff>> Count<Diff> for GeoDiffCount<'_, C> {
}
}

/// Helper iterator which drops two consecutive items if they are equal.
/// Note: this is different from the unique operation! E.g. the sequence [1, 1, 1, 2, 2]
/// is converted by the XorIterator into the sequence [1], whereas the unique operation
/// would output [1, 2].
struct XorIterator<I: Iterator<Item = usize>> {
iter: Peekable<I>,
}

impl<I: Iterator<Item = usize>> Iterator for XorIterator<I> {
type Item = usize;

fn next(&mut self) -> Option<Self::Item> {
loop {
match self.iter.next() {
Some(bit) if Some(&bit) == self.iter.peek() => {
self.iter.next();
}
x => return x,
}
}
}
}

#[cfg(test)]
mod tests {
use itertools::Itertools;
Expand Down

0 comments on commit fa0b732

Please sign in to comment.