mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
paste: Reuse output
allocation
This commit is contained in:
parent
8905d52279
commit
ff14f25c34
1 changed files with 3 additions and 2 deletions
|
@ -94,9 +94,10 @@ fn paste(filenames: Vec<String>, serial: bool, delimiters: &str) -> UResult<()>
|
|||
let mut stdout = stdout.lock();
|
||||
|
||||
let mut line = String::new();
|
||||
let mut output = String::new();
|
||||
if serial {
|
||||
for file in &mut files {
|
||||
let mut output = String::new();
|
||||
output.clear();
|
||||
loop {
|
||||
line.clear();
|
||||
match read_line(file.as_mut(), &mut line) {
|
||||
|
@ -115,7 +116,7 @@ fn paste(filenames: Vec<String>, serial: bool, delimiters: &str) -> UResult<()>
|
|||
} else {
|
||||
let mut eof = vec![false; files.len()];
|
||||
loop {
|
||||
let mut output = String::new();
|
||||
output.clear();
|
||||
let mut eof_count = 0;
|
||||
for (i, file) in files.iter_mut().enumerate() {
|
||||
if eof[i] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue