From c39cfe4fa374ecd2a9aeb616af92f5598dc7bd48 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 16 Aug 2026 11:20:43 -0700 Subject: [PATCH] sed: remove compile_program use of MB_CUR_MAX * sed/compile.c (compile_program): Use localeinfo.multibyte as it should be a bit faster than using MB_CUR_MAX. --- sed/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sed/compile.c b/sed/compile.c index 4b1c292..144233f 100644 --- a/sed/compile.c +++ b/sed/compile.c @@ -1182,7 +1182,7 @@ compile_program (struct vector *vector) /* If multibyte, count the source buffer's characters. */ idx_t src_char_num = 0; - if (MB_CUR_MAX != 1) + if (localeinfo.multibyte) for (idx_t i = 0; i < len; i += mcel_scan (src_buf + i, src_buf + len).len) src_char_num++;