sed: MB_CUR_MAX→MB_LEN_MAX for speed

* 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.
This commit is contained in:
Paul Eggert committed 2026-08-17 01:17:23 -07:00
1 parent 0222c34e3a
commit f137d0a95f
1 file changed
+2 -2
+2 -2
View File
@@ -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);