]> git.ipfire.org Git - thirdparty/coreutils.git/commit
yes: improve efficiency when all args aren't buffered
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 10 Mar 2015 12:25:48 +0000 (12:25 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 10 Mar 2015 12:30:33 +0000 (12:30 +0000)
commite2e11119e0ac653bd0bdab91c189b7803f8df1f0
tree47b82ed120099802b15c5422849c35bcd13402ff
parent35217221c211f3116f374f305654462195aa634a
yes: improve efficiency when all args aren't buffered

* src/yes.c (main): Even when the internal buffer isn't large enough,
output what we've buffered already, and interate over the rest.
This improves the performance in the edge case where there are
many small arguments that overflow the buffer.
* tests/misc/yes.sh: Add a test case for the many small arguments case.
src/yes.c
tests/misc/yes.sh