summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-05 04:50:26 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-05 04:50:26 +0000
commit5a89daa8ec9b19ce15af46edf1370e5e0067ec4e (patch)
tree6efff731a81de1f1a3966b6fca889193c3b960c9 /toke.c
parent9b0e499bcdd1e62b4ead7739d3482d056b5ac3dc (diff)
downloadperl-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
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 8a2130322b..a7be0a4500 100644
--- a/toke.c
+++ b/toke.c
@@ -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) :