From: Paul Eggert Date: Tue, 16 Jan 2024 21:48:32 +0000 (-0800) Subject: split: do not shrink hold buffer X-Git-Tag: v9.5~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4c5ed8f4e9cd55a12966d4f520e3a13101637d9;p=thirdparty%2Fcoreutils.git split: do not shrink hold buffer * src/split.c (line_bytes_split): Do not shrink hold buffer. If it’s large for this batch it’s likely to be large for the next batch, and for ‘split’ it’s not worth the complexity/CPU hassle to shrink it. Do not assume hold_size can be bufsize. --- diff --git a/src/split.c b/src/split.c index 64020c859f..037960a594 100644 --- a/src/split.c +++ b/src/split.c @@ -809,10 +809,7 @@ line_bytes_split (intmax_t n_bytes, char *buf, idx_t bufsize) { cwrite (n_out == 0, hold, n_hold); n_out += n_hold; - if (n_hold > bufsize) - hold = xirealloc (hold, bufsize); n_hold = 0; - hold_size = bufsize; } /* Output to eol if present. */