From 5a89daa8ec9b19ce15af46edf1370e5e0067ec4e Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 5 Mar 2000 04:50:26 +0000 Subject: [PATCH] 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 --- toke.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toke.c b/toke.c index 8a21303..a7be0a4 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) : -- 2.7.4