From 915544426781d184e3b057e63a20c089a32d3eba Mon Sep 17 00:00:00 2001 From: Richard Leach Date: Sun, 20 Mar 2022 19:05:10 +0000 Subject: [PATCH] Perl_newSViv: simplify by using (inline) newSV_type --- sv.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/sv.c b/sv.c index b32e1bf145f1..8ddf159adaa6 100644 --- a/sv.c +++ b/sv.c @@ -9687,20 +9687,7 @@ SV is set to 1. SV * Perl_newSViv(pTHX_ const IV i) { - SV *sv; - - new_SV(sv); - - /* Inlining ONLY the small relevant subset of sv_setiv here - * for performance. Makes a significant difference. */ - - /* We're starting from SVt_FIRST, so provided that's - * actual 0, we don't have to unset any SV type flags - * to promote to SVt_IV. */ - STATIC_ASSERT_STMT(SVt_FIRST == 0); - - SET_SVANY_FOR_BODYLESS_IV(sv); - SvFLAGS(sv) |= SVt_IV; + SV *sv = newSV_type(SVt_IV); (void)SvIOK_on(sv); SvIV_set(sv, i);