Skip to content

Commit

Permalink
no while let chain
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcasale committed Apr 25, 2024
1 parent 5677d61 commit 8dae817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion vortex-ipc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(let_chains)]
extern crate core;

use vortex_error::{vortex_err, VortexError};
Expand Down
10 changes: 5 additions & 5 deletions vortex-ipc/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,9 @@ impl<'a, R: Read> StreamArrayReader<'a, R> {
let mut found_so_far = 0;

// Continue reading batches from the stream until we either run out or find all indices
while found_so_far < indices.len()
&& let Some(batch) = self.next()?
{
while let Some(batch) = self.next()? {
let left =
search_sorted::<u64>(indices, offset as u64, SearchSortedSide::Left)?
.to_index();
search_sorted::<u64>(indices, offset as u64, SearchSortedSide::Left)?.to_index();
let right = search_sorted::<u64>(
indices,
offset as u64 + batch.len() as u64,
Expand All @@ -178,6 +175,9 @@ impl<'a, R: Read> StreamArrayReader<'a, R> {
found_so_far += from_current_batch.len();
chunks.push(from_current_batch);
offset += batch.len();
if found_so_far >= indices.len() {
break;
}
}
self.byte_offset = offset;
if found_so_far < idx_len {
Expand Down

0 comments on commit 8dae817

Please sign in to comment.