Skip to content

Commit 18c083d

Browse files
committed
do_readline: create new mortal with less branching
1 parent 43cb571 commit 18c083d

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
@@ -4189,7 +4189,8 @@ Perl_do_readline(pTHX)
41894189
}
41904190
else {
41914191
/* XXX on RC builds, push on stack rather than mortalize ? */
4192-
sv = sv_2mortal(newSV(80));
4192+
sv = newSV_type_mortal(SVt_PV);
4193+
sv_grow_fresh(sv, 81);
41934194
offset = 0;
41944195
}
41954196

@@ -4316,7 +4317,8 @@ Perl_do_readline(pTHX)
43164317
SvPV_shrink_to_cur(sv);
43174318
}
43184319
/* XXX on RC builds, push on stack rather than mortalize ? */
4319-
sv = sv_2mortal(newSV(80));
4320+
sv = newSV_type_mortal(SVt_PV);
4321+
sv_grow_fresh(sv, 81);
43204322
continue;
43214323
}
43224324

0 commit comments

Comments
 (0)