diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-01-28 13:38:28 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-01-28 13:38:28 +0000 |
commit | 4f2da183afece5ce28d1dcdb66d8d931eb0d976a (patch) | |
tree | 0ac0c94cde46c822be65a07383ae61e30a90a9dd /sv.c | |
parent | b8473700d76df372cb0ff6b7c4953731e2d985c2 (diff) | |
download | perl-4f2da183afece5ce28d1dcdb66d8d931eb0d976a.tar.gz |
By changing SvVOK() from returning 0/1 to 0/pointer-to-magic we can
save duplicating mg_find calls, without changing the semantics in any
boolean context.
p4raw-id: //depot/perl@26979
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -3417,11 +3417,13 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) SvIsUV_on(dstr); SvIV_set(dstr, SvIVX(sstr)); } - if (SvVOK(sstr)) { - const MAGIC * const smg = mg_find(sstr,PERL_MAGIC_vstring); - sv_magic(dstr, NULL, PERL_MAGIC_vstring, - smg->mg_ptr, smg->mg_len); - SvRMAGICAL_on(dstr); + { + const MAGIC * const smg = SvVOK(sstr); + if (smg) { + sv_magic(dstr, NULL, PERL_MAGIC_vstring, + smg->mg_ptr, smg->mg_len); + SvRMAGICAL_on(dstr); + } } } else if (sflags & SVp_IOK) { |