Skip to content

Commit

Permalink
refactor(rust): remove redundant if branch in nested parquet (#11814)
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion authored Oct 18, 2023
1 parent f5f3fa9 commit d6ef2e4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,6 @@ where
if *remaining == 0 && items.is_empty() {
return MaybeNext::None;
}
if !items.is_empty() && items.front().unwrap().0.len() > chunk_size.unwrap_or(usize::MAX) {
return MaybeNext::Some(Ok(items.pop_front().unwrap()));
}

match iter.next() {
Err(e) => MaybeNext::Some(Err(e.into())),
Expand Down Expand Up @@ -539,7 +536,8 @@ where
Err(e) => return MaybeNext::Some(Err(e)),
};

// if possible, return the value immediately.
// this comparison is strictly greater to ensure the contents of the
// row are fully read.
if !items.is_empty()
&& items.front().unwrap().0.len() > chunk_size.unwrap_or(usize::MAX)
{
Expand Down

0 comments on commit d6ef2e4

Please sign in to comment.