sort: write empty file when input is empty#11969
sort: write empty file when input is empty#11969hideyosh1 wants to merge 1 commit intouutils:mainfrom
Conversation
There was a problem hiding this comment.
Does this even compile? "chunk" is being used before the definition a few lines later.
There was a problem hiding this comment.
Or can we merge ReadResult::EmptyInput => { logic to another => for simplicity?
There was a problem hiding this comment.
how so ? just creating a new chunk and passing ReadResult::SortedSingleChunk(first_chunk) ?
but this seems very unwieldy and slow
There was a problem hiding this comment.
Something like this might avoid a heap allocation? Not sure it matters.
ReadResult::EmptyInput => {
print_sorted(std::iter::empty::<&[u8]>(), settings, output)?;
}|
thanks for your review, i think ive fixed these issues... instead i used |
|
GNU testsuite comparison: |
Merging this PR will not alter performance
Comparing Footnotes
|
* adds implementations for this behavior in both threaded and wasi * adds test for this behavior Co-authored-by: Chad Brewbaker <crb002@gmail.com>
adds implementations for this behavior in both threaded and wasi
adds test for this behavior
Closes #11958
sorry, this is my first contribution, be gentle please...