diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-05 04:50:26 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-05 04:50:26 +0000 |
commit | 5a89daa8ec9b19ce15af46edf1370e5e0067ec4e (patch) | |
tree | 6efff731a81de1f1a3966b6fca889193c3b960c9 | |
parent | 9b0e499bcdd1e62b4ead7739d3482d056b5ac3dc (diff) | |
download | perl-5a89daa8ec9b19ce15af46edf1370e5e0067ec4e.tar.gz |
optimize change#5533 to stick to IVs if constant is <= IV_MAX,
since runtime is highly optimized for IVs rather than UVs
p4raw-link: @5533 on //depot/perl: 9b0e499bcdd1e62b4ead7739d3482d056b5ac3dc
p4raw-id: //depot/perl@5534
-rw-r--r-- | toke.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -6954,8 +6954,12 @@ Perl_scan_num(pTHX_ char *start) conversion at all. */ tryuv = U_V(value); - if (!floatit && (NV)tryuv == value) - sv_setuv(sv, tryuv); + if (!floatit && (NV)tryuv == value) { + if (tryuv <= IV_MAX) + sv_setiv(sv, (IV)tryuv); + else + sv_setuv(sv, tryuv); + } else sv_setnv(sv, value); if ( floatit ? (PL_hints & HINT_NEW_FLOAT) : |