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

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3901: Add iterators to BooleanBuffer and NullBuffer

tustvold commented on code in PR #3901:
URL: https://github.com/apache/arrow-rs/pull/3901#discussion_r1145266905


##########
arrow-buffer/src/buffer/null.rs:
##########
@@ -114,6 +114,23 @@ impl NullBuffer {
         Self::new(self.buffer.slice(offset, len))
     }
 
+    /// Returns an iterator over the bits in this [`NullBuffer`]
+    ///
+    /// Note: [`Self::valid_indices`] will be significantly faster for most use-cases
+    pub fn iter(&self) -> BitIterator<'_> {
+        self.buffer.iter()
+    }
+
+    /// Returns a [`BitIndexIterator`] over the valid indices in this [`NullBuffer`]
+    pub fn valid_indices(&self) -> BitIndexIterator<'_> {

Review Comment:
   Yeah, I figured that it might avoid some confusion perhaps



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