Skip to content

Commit 464d172

Browse files
Update src/uu/cat/src/cat.rs
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
1 parent 5063d17 commit 464d172

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/uu/cat/src/cat.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ fn write_end<W: Write>(writer: &mut W, in_buf: &[u8], options: &OutputOptions) -
613613
// however, write_nonprint_to_end doesn't need to stop at \r because it will always write \r as ^M.
614614
// Return the number of written symbols
615615
fn write_to_end<W: Write>(in_buf: &[u8], writer: &mut W) -> usize {
616+
// using memchr2 significantly improves performances
616617
match memchr2(b'\n', b'\r', in_buf) {
617618
Some(p) => {
618619
writer.write_all(&in_buf[..p]).unwrap();

0 commit comments

Comments
 (0)