Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li committed Feb 28, 2022
1 parent 05faaa2 commit 2b06aa2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,14 @@ harness = false
name = "comparison_kernels"
harness = false

## disabled because we don't have the path of env `CARGO_MANIFEST_DIR`

# [[bench]]
# name = "read_parquet"
# harness = false
[[bench]]
name = "read_parquet"
harness = false

# [[bench]]
# name = "write_parquet"
# harness = false
[[bench]]
name = "write_parquet"
harness = false

[[bench]]
name = "aggregate"
Expand Down
9 changes: 9 additions & 0 deletions src/types/bit_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ impl<T: BitChunk> Iterator for BitChunkIter<T> {
}
}

// # Safety
// a mathematical invariant of this iterator
unsafe impl<T: BitChunk> crate::trusted_len::TrustedLen for BitChunkIter<T> {}

/// An [`Iterator<Item=usize>`] over a [`BitChunk`].
/// This iterator returns the postion of bit set.
/// Refer: https://lemire.me/blog/2018/03/08/iterating-over-set-bits-quickly-simd-edition/
Expand Down Expand Up @@ -147,6 +151,10 @@ impl<T: BitChunk> Iterator for BitChunkOnes<T> {
}
}

// # Safety
// a mathematical invariant of this iterator
unsafe impl<T: BitChunk> crate::trusted_len::TrustedLen for BitChunkOnes<T> {}

#[cfg(test)]
mod tests {
use super::*;
Expand All @@ -165,6 +173,7 @@ mod tests {
let a = [0b00000001, 0b00010000]; // 0th and 13th entry
let a = u16::from_ne_bytes(a);
let mut iter = BitChunkOnes::new(a);
assert_eq!(iter.size_hint(), (2, Some(2)));
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(12));
}
Expand Down

0 comments on commit 2b06aa2

Please sign in to comment.