Skip to content

Commit

Permalink
Perl_newSViv: simplify by using (inline) newSV_type
Browse files Browse the repository at this point in the history
  • Loading branch information
richardleach authored and xenu committed Mar 20, 2022
1 parent b944b7b commit 9155444
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9155444

Please sign in to comment.