diff options
author | Nicholas Clark <nick@ccl4.org> | 2000-12-13 20:08:50 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-14 23:40:58 +0000 |
commit | 16b7a9a47be196cb33bf757faad24e73ceffc2fc (patch) | |
tree | 674fd0d579f19451971d374d3735712349332279 /op.c | |
parent | 1503adc40cad8d289062bdd60154f660cdeb7188 (diff) | |
download | perl-16b7a9a47be196cb33bf757faad24e73ceffc2fc.tar.gz |
faster and 64 bit preserving arithmetic
Message-ID: <20001213200849.B71166@plum.flirble.org>
p4raw-id: //depot/perl@8119
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -2249,13 +2249,11 @@ Perl_fold_constants(pTHX_ register OP *o) if ((SvFLAGS(sv) & (SVf_IOK|SVf_NOK|SVf_POK)) == SVf_NOK && type != OP_NEGATE) { - IV iv = SvIV(sv); - if ((NV)iv == SvNV(sv)) { - SvREFCNT_dec(sv); - sv = newSViv(iv); - } - else - SvIOK_off(sv); /* undo SvIV() damage */ +#ifdef PERL_PRESERVE_IVUV + /* Only bother to attempt to fold to IV if + most operators will benefit */ + SvIV_please(sv); +#endif } return newSVOP(OP_CONST, 0, sv); } |