Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
use map for new in fixed_size_list_scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
illumination-k committed Jan 23, 2022
1 parent 63224cc commit 45b6e78
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/scalar/fixed_size_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ impl FixedSizeListScalar {
pub fn new(data_type: DataType, values: Option<Arc<dyn Array>>) -> Self {
let (field, size) = FixedSizeListArray::get_child_and_size(&data_type);
let inner_data_type = field.data_type();
let values = match values {
Some(values) => {
assert_eq!(inner_data_type, values.data_type());
assert_eq!(size, values.len());
Some(values)
}
None => None,
};
let values = values.map(|x| {
assert_eq!(inner_data_type, x.data_type());
assert_eq!(size, x.len());
x
});
Self { values, data_type }
}

Expand Down

0 comments on commit 45b6e78

Please sign in to comment.