From f137d0a95f9a2212e4c4d78ac232fb68bef08b7e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 14 Aug 2026 17:21:56 -0700 Subject: [PATCH] =?UTF-8?q?sed:=20MB=5FCUR=5FMAX=E2=86=92MB=5FLEN=5FMAX=20?= =?UTF-8?q?for=20speed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * sed/execute.c (str_append_modified): Use MB_LEN_MAX not MB_CUR_MAX, as it’s a bit faster and there’s little point to space optimization here. --- sed/execute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sed/execute.c b/sed/execute.c index 53479d8..2fa45d1 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -173,8 +173,8 @@ str_append_modified (struct line *to, const char *string, idx_t length, return; } - idx_t mb_cur_max = MB_CUR_MAX, worst_case_growth; - if (ckd_mul (&worst_case_growth, length, mb_cur_max)) + idx_t worst_case_growth; + if (ckd_mul (&worst_case_growth, length, MB_LEN_MAX)) xalloc_die (); if (to->alloc - to->length < worst_case_growth) resize_line (to, worst_case_growth);