mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
tac: lock stdout only once instead for each line
This commit is contained in:
parent
e041fda51d
commit
0d583754ca
1 changed files with 4 additions and 2 deletions
|
@ -105,7 +105,8 @@ fn buffer_tac_regex(
|
|||
pattern: ®ex::bytes::Regex,
|
||||
before: bool,
|
||||
) -> std::io::Result<()> {
|
||||
let mut out = stdout();
|
||||
let out = stdout();
|
||||
let mut out = out.lock();
|
||||
|
||||
// The index of the line separator for the current line.
|
||||
//
|
||||
|
@ -171,7 +172,8 @@ fn buffer_tac_regex(
|
|||
/// `separator` appears at the beginning of each line, as in
|
||||
/// `"/abc/def"`.
|
||||
fn buffer_tac(data: &[u8], before: bool, separator: &str) -> std::io::Result<()> {
|
||||
let mut out = stdout();
|
||||
let out = stdout();
|
||||
let mut out = out.lock();
|
||||
|
||||
// The number of bytes in the line separator.
|
||||
let slen = separator.as_bytes().len();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue