From c77141fb3a717bd2d7699c235f4909c5d4f6d301 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 15 Feb 2024 19:40:45 +0100 Subject: [PATCH] nstrftime, fprintftime: Optimize. * lib/strftime.c (should_remove_ampm): Call gl_locale_name_unsafe instead of gl_locale_name. * modules/nstrftime (Depends-on): Remove localename. Add localename-unsafe. --- ChangeLog | 8 ++++++++ lib/strftime.c | 2 +- modules/nstrftime | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 487e5cf1dd..68a0050a68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-02-15 Bruno Haible + + nstrftime, fprintftime: Optimize. + * lib/strftime.c (should_remove_ampm): Call gl_locale_name_unsafe + instead of gl_locale_name. + * modules/nstrftime (Depends-on): Remove localename. Add + localename-unsafe. + 2024-02-15 Bruno Haible localename-unsafe: Optimize. diff --git a/lib/strftime.c b/lib/strftime.c index c7256c3d35..128176cad4 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -401,7 +401,7 @@ should_remove_ampm (void) lt lv mg mhr mi mk mn ms mt nb nds nhn nl nn nr nso oc os pap pl pt ro ru rw sah sc se sgs sk sl sm sr ss st su sv szl tg tk tn ts tt ug uk unm uz ve wae wo xh zu */ - const char *loc = gl_locale_name (LC_TIME, "LC_TIME"); + const char *loc = gl_locale_name_unsafe (LC_TIME, "LC_TIME"); bool remove_ampm = false; switch (loc[0]) { diff --git a/modules/nstrftime b/modules/nstrftime index 77a8594c4c..c5ab2710c0 100644 --- a/modules/nstrftime +++ b/modules/nstrftime @@ -15,7 +15,7 @@ errno extensions intprops libc-config -localename +localename-unsafe stdbool stdckdint time_rz -- 2.39.5