Skip to content

Commit

Permalink
locale.c: Remove one-off macro
Browse files Browse the repository at this point in the history
This was used to prevent an unnecessary copy.  But the next commit will
change the macro it was avoiding to not always do the copy.  That will
avoid more copies than this would. The copy that results will still be
unnecessary in some cases, but there is a net gain.
  • Loading branch information
khwilliamson committed May 22, 2023
1 parent 7703320 commit 7d850ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions locale.c
Expand Up @@ -1259,8 +1259,6 @@ S_less_dicey_bool_setlocale_r(pTHX_ const int cat, const char * locale)
# include <libintl.h>
# endif

# define my_querylocale_c(cat) querylocale_2008_i(cat##_INDEX_)

STATIC const char *
S_querylocale_2008_i(pTHX_ const unsigned int index)
{
Expand Down Expand Up @@ -1806,7 +1804,7 @@ S_bool_setlocale_2008_i(pTHX_
/* Invalidate the glibc cache of loaded translations if the locale has
* changed, see [perl #134264] */
if (old_messages_locale) {
if (strNE(old_messages_locale, my_querylocale_c(LC_MESSAGES))) {
if (strNE(old_messages_locale, querylocale_c(LC_MESSAGES))) {
textdomain(textdomain(NULL));
}
}
Expand Down

0 comments on commit 7d850ed

Please sign in to comment.