summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-07-02 12:34:08 +0000
committerNicholas Clark <nick@ccl4.org>2005-07-02 12:34:08 +0000
commit43c5f42db1e336a99904bcc798b7070727bfbd0a (patch)
tree1e02933dfd6fac99b7933947f33451769fd8467e /locale.c
parent0cf8ddea3351f0ff9eef736dfa13bc866d0d1f97 (diff)
downloadperl-43c5f42db1e336a99904bcc798b7070727bfbd0a.tar.gz
Don't check the pointer is non-NULL before calling Safefree() in
little used code, code used only once per run (such as interpreter construction and destruction), and cases where the pointer nearly never is NULL. Safefree does its own non-NULL check, and even that isn't strictly necessary as all conformant free()s accept a NULL pointer. p4raw-id: //depot/perl@25045
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/locale.c b/locale.c
index 77a83fd850..40d2a4415e 100644
--- a/locale.c
+++ b/locale.c
@@ -112,10 +112,8 @@ Perl_new_numeric(pTHX_ const char *newnum)
#ifdef USE_LOCALE_NUMERIC
if (! newnum) {
- if (PL_numeric_name) {
- Safefree(PL_numeric_name);
- PL_numeric_name = NULL;
- }
+ Safefree(PL_numeric_name);
+ PL_numeric_name = NULL;
PL_numeric_standard = TRUE;
PL_numeric_local = TRUE;
return;
@@ -534,16 +532,13 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
#endif
#ifdef USE_LOCALE_CTYPE
- if (curctype != NULL)
- Safefree(curctype);
+ Safefree(curctype);
#endif /* USE_LOCALE_CTYPE */
#ifdef USE_LOCALE_COLLATE
- if (curcoll != NULL)
- Safefree(curcoll);
+ Safefree(curcoll);
#endif /* USE_LOCALE_COLLATE */
#ifdef USE_LOCALE_NUMERIC
- if (curnum != NULL)
- Safefree(curnum);
+ Safefree(curnum);
#endif /* USE_LOCALE_NUMERIC */
return ok;
}