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


##########
arrow-buffer/src/buffer/null.rs:
##########
@@ -218,6 +218,30 @@ impl<'a> IntoIterator for &'a NullBuffer {
     }
 }
 
+impl From<BooleanBuffer> for NullBuffer {
+    fn from(value: BooleanBuffer) -> Self {
+        Self::new(value)
+    }
+}
+
+impl From<&[bool]> for NullBuffer {

Review Comment:
   I debated adding custom conversion that would count the nulls, but I wasn't 
entirely convinced it would be faster - as the bit counting is very fast, so I 
left it for now. We can easily optimise later



##########
arrow-buffer/src/buffer/null.rs:
##########
@@ -218,6 +218,30 @@ impl<'a> IntoIterator for &'a NullBuffer {
     }
 }
 
+impl From<BooleanBuffer> for NullBuffer {
+    fn from(value: BooleanBuffer) -> Self {
+        Self::new(value)
+    }
+}
+
+impl From<&[bool]> for NullBuffer {

Review Comment:
   I debated adding custom conversion that would count the nulls, but I wasn't 
entirely convinced it would be faster - as the bit counting is very fast, so I 
left it for now. We can easily optimise later



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to