From: Nicholas Clark Date: Sun, 5 Feb 2006 22:41:42 +0000 (+0000) Subject: Start to merge the 6 arms of S_pvgv_assign into one. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2440974c613a07f60a43a78d95afb910d160604b;p=p5sagit%2Fp5-mst-13.2.git Start to merge the 6 arms of S_pvgv_assign into one. p4raw-id: //depot/perl@27098 --- diff --git a/sv.c b/sv.c index 8b00fb5..243c8c2 100644 --- a/sv.c +++ b/sv.c @@ -3074,6 +3074,7 @@ S_pvgv_assign(pTHX_ SV *dstr, SV *sstr) { SV * const sref = SvREFCNT_inc(SvRV(sstr)); SV *dref = NULL; const int intro = GvINTRO(dstr); + SV **location; #ifdef GV_UNIQUE_CHECK if (GvUNIQUE((GV*)dstr)) { @@ -3168,18 +3169,16 @@ S_pvgv_assign(pTHX_ SV *dstr, SV *sstr) { } break; case SVt_PVIO: - if (intro) - SAVEGENERICSV(GvIOp(dstr)); - else - dref = (SV*)GvIOp(dstr); - GvIOp(dstr) = (IO*)sref; - break; + location = (SV **) &GvIOp(dstr); + goto common; case SVt_PVFM: + location = (SV **) &GvFORM(dstr); + common: if (intro) - SAVEGENERICSV(GvFORM(dstr)); + SAVEGENERICSV(*location); else - dref = (SV*)GvFORM(dstr); - GvFORM(dstr) = (CV*)sref; + dref = *location; + *location = sref; break; default: if (intro)