From: Nicholas Clark Date: Sat, 11 Feb 2006 15:10:32 +0000 (+0000) Subject: Coalesce 2 if blocks with duplicated conditions in Perl_sv_dup. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=100ce7e1cb4288a58223cf8260b009d2f598d81b;p=p5sagit%2Fp5-mst-13.2.git Coalesce 2 if blocks with duplicated conditions in Perl_sv_dup. p4raw-id: //depot/perl@27159 --- diff --git a/sv.c b/sv.c index a26c14a..883ba58 100644 --- a/sv.c +++ b/sv.c @@ -9624,8 +9624,6 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param) else IoOFP(dstr) = fp_dup(IoOFP(dstr), IoTYPE(dstr), param); /* PL_rsfp_filters entries have fake IoDIRP() */ - if (IoDIRP(dstr) && !(IoFLAGS(dstr) & IOf_FAKE_DIRP)) - IoDIRP(dstr) = dirp_dup(IoDIRP(dstr)); if(IoFLAGS(dstr) & IOf_FAKE_DIRP) { /* I have no idea why fake dirp (rsfps) should be treated differently but otherwise @@ -9637,6 +9635,11 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param) IoTOP_GV(dstr) = gv_dup(IoTOP_GV(dstr), param); IoFMT_GV(dstr) = gv_dup(IoFMT_GV(dstr), param); IoBOTTOM_GV(dstr) = gv_dup(IoBOTTOM_GV(dstr), param); + if (IoDIRP(dstr)) { + IoDIRP(dstr) = dirp_dup(IoDIRP(dstr)); + } else { + /* IoDIRP(dstr) is already a copy of IoDIRP(sstr) */ + } } IoTOP_NAME(dstr) = SAVEPV(IoTOP_NAME(dstr)); IoFMT_NAME(dstr) = SAVEPV(IoFMT_NAME(dstr));