Commit 74bc971809 for perl
commit 74bc971809a9e9289fd49490f0232b7378ec49ac
Author: Richard Leach <rich+perl@hyphen-dash-hyphen.info>
Date: Wed Nov 4 14:24:11 2026 +0000
pp_subst: more efficient creation of _iters_ retval
Note: The additional instructions required to do this inline with
something like the following didn't seem worthwhile:
retval = newSV_type_mortal(SVt_IV);
retval->sv_u.svu_iv = iters;
SvFLAGS(retval) |= (SVf_IOK|SVp_IOK|...);
diff --git a/pp_hot.c b/pp_hot.c
index df0754bccd..1f419f8ca1 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -5783,8 +5783,7 @@ PP(pp_subst)
if (PL_op->op_private & OPpTRUEBOOL)
retval = &PL_sv_yes;
else {
- retval = sv_newmortal();
- sv_setiv(retval, iters);
+ retval = sv_2mortal(newSViv(iters));
}
ret: