This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 4a0b768807 Remove redundant unsafe in test (#12914)
4a0b768807 is described below
commit 4a0b7688074880767e1e032400c1e97b7ffcb76e
Author: Piotr Findeisen <[email protected]>
AuthorDate: Tue Oct 15 16:58:26 2024 +0200
Remove redundant unsafe in test (#12914)
Unsafe `StructArray::new_unchecked` is a more performant alternative to
`StructArray::new`. In test code there is no benefit from using the
unsafe code path.
---
datafusion/common/src/scalar/mod.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/datafusion/common/src/scalar/mod.rs
b/datafusion/common/src/scalar/mod.rs
index f543dc5f0c..43f22265f5 100644
--- a/datafusion/common/src/scalar/mod.rs
+++ b/datafusion/common/src/scalar/mod.rs
@@ -6603,7 +6603,7 @@ mod tests {
let not_nulls = not_nulls.finish();
let not_nulls = Some(NullBuffer::new(not_nulls));
- let ar = unsafe { StructArray::new_unchecked(fields, arrays,
not_nulls) };
+ let ar = StructArray::new(fields, arrays, not_nulls);
let s = ScalarValue::Struct(Arc::new(ar));
assert_eq!(s.to_string(), "{a:1,b:2}");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]