Skip to content

Commit

Permalink
Minor: simplify the function GenericListArray::get_type (#1650)
Browse files Browse the repository at this point in the history
* simplify the code

Signed-off-by: remzi <13716567376yh@gmail.com>

* correct the format

Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 authored May 5, 2022
1 parent e51de5e commit 884de44
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arrow/src/array/array_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,11 @@ impl<OffsetSize: OffsetSizeTrait> GenericListArray<OffsetSize> {

#[inline]
fn get_type(data_type: &DataType) -> Option<&DataType> {
if OffsetSize::is_large() {
if let DataType::LargeList(child) = data_type {
match (OffsetSize::is_large(), data_type) {
(true, DataType::LargeList(child)) | (false, DataType::List(child)) => {
Some(child.data_type())
} else {
None
}
} else if let DataType::List(child) = data_type {
Some(child.data_type())
} else {
None
_ => None,
}
}

Expand Down

0 comments on commit 884de44

Please sign in to comment.