Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions src/uu/split/src/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,16 +1028,16 @@ impl ManageOutFiles for OutFiles {
// Could have hit system limit for open files.
// Try to close one previously instantiated writer first
for (i, out_file) in self.iter_mut().enumerate() {
if i != idx {
if let Some(writer) = out_file.maybe_writer.as_mut() {
writer.flush()?;
out_file.maybe_writer = None;
out_file.is_new = false;
count += 1;

// And then try to instantiate the writer again
continue 'loop1;
}
if i != idx
&& let Some(writer) = out_file.maybe_writer.as_mut()
{
writer.flush()?;
out_file.maybe_writer = None;
out_file.is_new = false;
count += 1;

// And then try to instantiate the writer again
continue 'loop1;
}
}

Expand Down Expand Up @@ -1331,11 +1331,8 @@ where
if settings.elide_empty_files && skipped > 0 && kth_chunk.is_none() {
chunk_number -= skipped as u64;
}

if let Some(kth) = kth_chunk {
if chunk_number > kth {
break;
}
if kth_chunk.is_some_and(|k| chunk_number > k) {
break;
}
}
Ok(())
Expand Down
Loading