Skip to content

Commit a3a284f

Browse files
committed
do_readline: create new mortal with less branching
1 parent 829b1d4 commit a3a284f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pp_hot.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4183,7 +4183,8 @@ Perl_do_readline(pTHX)
41834183
}
41844184
else {
41854185
/* XXX on RC builds, push on stack rather than mortalize ? */
4186-
sv = sv_2mortal(newSV(80));
4186+
sv = newSV_type_mortal(SVt_PV);
4187+
sv_grow_fresh(sv, 81);
41874188
offset = 0;
41884189
}
41894190

@@ -4310,7 +4311,8 @@ Perl_do_readline(pTHX)
43104311
SvPV_shrink_to_cur(sv);
43114312
}
43124313
/* XXX on RC builds, push on stack rather than mortalize ? */
4313-
sv = sv_2mortal(newSV(80));
4314+
sv = newSV_type_mortal(SVt_PV);
4315+
sv_grow_fresh(sv, 81);
43144316
continue;
43154317
}
43164318

0 commit comments

Comments
 (0)