From: Bruno Haible Date: Thu, 15 Feb 2024 18:40:45 +0000 (+0100) Subject: nstrftime, fprintftime: Optimize. X-Git-Tag: v1.0~416 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c77141fb3a717bd2d7699c235f4909c5d4f6d301;p=gnulib.git 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. --- 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