You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "viirya (via GitHub)" <gi...@apache.org> on 2023/03/01 20:37:59 UTC

[GitHub] [arrow-rs] viirya commented on a diff in pull request #3778: Use NullBuffer in ArrayData (#3775)

viirya commented on code in PR #3778:
URL: https://github.com/apache/arrow-rs/pull/3778#discussion_r1122274287


##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -81,4 +104,39 @@ impl BooleanBuffer {
     pub fn values(&self) -> &[u8] {
         &self.buffer
     }
+
+    /// Slices this [`BooleanBuffer`] by the provided `offset` and `length`
+    pub fn slice(&self, offset: usize, len: usize) -> Self {
+        assert!(
+            offset.saturating_add(len) <= self.len,
+            "the offset of the new BooleanBuffer cannot exceed the existing length"

Review Comment:
   ```suggestion
               "the offset + length of the new BooleanBuffer cannot exceed the existing length"
   ```



-- 
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