You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/30 14:17:29 UTC

[GitHub] [arrow-rs] mathiaspeters-sig commented on a change in pull request #716: Optimize array::transform::utils::set_bits

mathiaspeters-sig commented on a change in pull request #716:
URL: https://github.com/apache/arrow-rs/pull/716#discussion_r698527363



##########
File path: arrow/src/array/transform/utils.rs
##########
@@ -74,3 +103,130 @@ pub(super) unsafe fn get_last_offset<T: OffsetSizeTrait>(
     debug_assert!(prefix.is_empty() && suffix.is_empty());
     *offsets.get_unchecked(offsets.len() - 1)
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_set_bits_aligned() {
+        let mut destination: Vec<u8> = vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+        let source: &[u8] = &[
+            0b11100111, 0b11100111, 0b11100111, 0b11100111, 0b11100111, 0b11100111,
+            0b11100111, 0b11100111,

Review comment:
       That is a good idea. I changed the patterns, although it know repeats every 7 bytes, but I doubt there will be any "off by 48" errors and we don't have enough data for an "off by 64" error




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org