From 9e57e4e1f6e7bfdd5b24346f59baf1013cdf7cc6 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 11 Apr 2021 05:57:07 -0600 Subject: [PATCH] locale.c: Skip code if will be a no-op The previous commits have fixed things up so that at this point in the code nothing has changed, and if nothing will change, we can just return --- locale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale.c b/locale.c index b17a34bd9ec4..fd2d77e76808 100644 --- a/locale.c +++ b/locale.c @@ -1606,14 +1606,14 @@ S_new_numeric(pTHX_ const char *newnum) */ - /* Save the new name if it isn't the same as the previous one, if any */ + /* If this isn't actually a change, do nothing */ if (PL_numeric_name && strEQ(PL_numeric_name, newnum)) { + return; } - else { + /* Save the locale name for future use */ Safefree(PL_numeric_name); PL_numeric_name = savepv(newnum); - } /* We are in the underlying locale until changed at the end of this * function */