From 566771cc1208eb7c5c8363435c4bd1299f0ae5e5 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 4 May 2009 18:53:39 +0100 Subject: Make Perl_hek_dup() cope with a NULL "source" parameter (by returning NULL). Change its callers to take advantage of this. --- sv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sv.c') diff --git a/sv.c b/sv.c index b13985b271..9d6fddf0e5 100644 --- a/sv.c +++ b/sv.c @@ -10505,7 +10505,7 @@ Perl_gp_dup(pTHX_ GP *const gp, CLONE_PARAMS *const param) ret->gp_cv = cv_dup_inc(gp->gp_cv, param); ret->gp_cvgen = gp->gp_cvgen; ret->gp_line = gp->gp_line; - ret->gp_file_hek = gp->gp_file_hek ? hek_dup(gp->gp_file_hek, param) : NULL; + ret->gp_file_hek = hek_dup(gp->gp_file_hek, param); return ret; } @@ -10954,8 +10954,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) LvTARG(dstr) = sv_dup_inc(LvTARG(dstr), param); case SVt_PVGV: if(isGV_with_GP(sstr)) { - if (GvNAME_HEK(dstr)) - GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param); + GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param); /* Don't call sv_add_backref here as it's going to be created as part of the magic cloning of the symbol table. */ @@ -11053,7 +11052,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) SvFLAGS(dstr) |= SVf_OOK; hvname = saux->xhv_name; - daux->xhv_name = hvname ? hek_dup(hvname, param) : hvname; + daux->xhv_name = hek_dup(hvname, param); daux->xhv_riter = saux->xhv_riter; daux->xhv_eiter = saux->xhv_eiter -- cgit v1.2.1