Skip to content

Commit

Permalink
Remove redundant unsafe in test (#12914)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
findepi authored Oct 15, 2024
1 parent a9b202c commit 4a0b768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datafusion/common/src/scalar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down

0 comments on commit 4a0b768

Please sign in to comment.