From 013abb9bfbbb8091fa79597e81e7208ef1fe2dde Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 1 Feb 2012 22:58:14 +0100 Subject: [PATCH] Update, correct and clarify the comment in Perl_sv_setuv(). See the correspondence on ticket #36459 for more details. --- sv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sv.c b/sv.c index 03c1874..ace74bc 100644 --- a/sv.c +++ b/sv.c @@ -1610,13 +1610,16 @@ Perl_sv_setuv(pTHX_ register SV *const sv, const UV u) { PERL_ARGS_ASSERT_SV_SETUV; - /* With these two if statements: + /* With the if statement to ensure that integers are stored as IVs whenever + possible: u=1.49 s=0.52 cu=72.49 cs=10.64 scripts=270 tests=20865 without u=1.35 s=0.47 cu=73.45 cs=11.43 scripts=270 tests=20865 - If you wish to remove them, please benchmark to see what the effect is + If you wish to remove the following if statement, so that this routine + (and its callers) always return UVs, please benchmark to see what the + effect is. Modern CPUs may be different. Or may not :-) */ if (u <= (UV)IV_MAX) { sv_setiv(sv, (IV)u); -- 1.8.3.1