Skip to content

Commit 013abb9

Browse files
committed
Update, correct and clarify the comment in Perl_sv_setuv().
See the correspondence on ticket #36459 for more details.
1 parent 41be41d commit 013abb9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sv.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,13 +1610,16 @@ Perl_sv_setuv(pTHX_ register SV *const sv, const UV u)
16101610
{
16111611
PERL_ARGS_ASSERT_SV_SETUV;
16121612

1613-
/* With these two if statements:
1613+
/* With the if statement to ensure that integers are stored as IVs whenever
1614+
possible:
16141615
u=1.49 s=0.52 cu=72.49 cs=10.64 scripts=270 tests=20865
16151616
16161617
without
16171618
u=1.35 s=0.47 cu=73.45 cs=11.43 scripts=270 tests=20865
16181619
1619-
If you wish to remove them, please benchmark to see what the effect is
1620+
If you wish to remove the following if statement, so that this routine
1621+
(and its callers) always return UVs, please benchmark to see what the
1622+
effect is. Modern CPUs may be different. Or may not :-)
16201623
*/
16211624
if (u <= (UV)IV_MAX) {
16221625
sv_setiv(sv, (IV)u);

0 commit comments

Comments
 (0)