Date: Wed, 26 Nov 2025 16:56:45 +0000 From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 5af240c54bd2 - main - libc: Simplify __get_locale() Message-ID: <6927314d.9b88.a55612e@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5af240c54bd2d9548536c904e841499e1651bcc8 commit 5af240c54bd2d9548536c904e841499e1651bcc8 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2025-11-26 16:54:52 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2025-11-26 16:56:42 +0000 libc: Simplify __get_locale() MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: fuz Differential Revision: https://reviews.freebsd.org/D53908 --- lib/libc/locale/xlocale_private.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index ef1a8687a376..4cb323d5fa4c 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -200,11 +200,9 @@ extern _Thread_local locale_t __thread_locale; */ static inline locale_t __get_locale(void) { - - if (!__has_thread_locale) { + if (!__has_thread_locale || __thread_locale == NULL) return (&__xlocale_global_locale); - } - return (__thread_locale ? __thread_locale : &__xlocale_global_locale); + return (__thread_locale); } /**help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6927314d.9b88.a55612e>
