summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-12-27 08:39:39 -0600
committerSteve Peters <steve@fisharerojo.org>2005-12-27 22:07:44 +0000
commitfabdb6c0879db76333e970b6c67260c877fc17b3 (patch)
tree81d106dc99b2069f6968bbe00164e6bb222dc482 /sv.c
parentf319e147b252268cc6fe404c58538ec32cf8548a (diff)
downloadperl-fabdb6c0879db76333e970b6c67260c877fc17b3.tar.gz
pre-likely cleanup
Message-ID: <20051227203939.GC1781@petdance.com> Includes a small fix to the changes in tryAMAGICbinW_var() in pp.h. p4raw-id: //depot/perl@26505
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sv.c b/sv.c
index 1ad6636f5c..3b69cb5f1a 100644
--- a/sv.c
+++ b/sv.c
@@ -2640,11 +2640,12 @@ Perl_sv_2bool(pTHX_ register SV *sv)
if (!SvOK(sv))
return 0;
if (SvROK(sv)) {
- SV* tmpsv;
- if (SvAMAGIC(sv) && (tmpsv=AMG_CALLun(sv,bool_)) &&
- (!SvROK(tmpsv) || (SvRV(tmpsv) != SvRV(sv))))
- return (bool)SvTRUE(tmpsv);
- return SvRV(sv) != 0;
+ if (SvAMAGIC(sv)) {
+ SV * const tmpsv = AMG_CALLun(sv,bool_);
+ if (tmpsv && (!SvROK(tmpsv) || (SvRV(tmpsv) != SvRV(sv))))
+ return (bool)SvTRUE(tmpsv);
+ }
+ return SvRV(sv) != 0;
}
if (SvPOKp(sv)) {
register XPV* const Xpvtmp = (XPV*)SvANY(sv);
@@ -3857,7 +3858,7 @@ void
Perl_sv_catpvn_flags(pTHX_ register SV *dsv, register const char *sstr, register STRLEN slen, I32 flags)
{
STRLEN dlen;
- const char *dstr = SvPV_force_flags(dsv, dlen, flags);
+ const char * const dstr = SvPV_force_flags(dsv, dlen, flags);
SvGROW(dsv, dlen + slen + 1);
if (sstr == dstr)