This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
optimise sv_setsv_flags()
This commit does two things.
First, it streamlines and re-orders some of the initial tests,
such as 'is sstr already freed?'.
Second, it looks for a reasonably common case where both sstr and dstr are
SVt_NULL/SVt_IV. This covers undef, int and refs, where the SV hasn't
previously been used for other things (like strings).
With just SVt_NULL/SVt_IV, we know that the SV won't have a real body, and
won't need one and can be very quick.
The check for SVt_NULL/SVt_IV is a single compare-and-branch, so
has a minimal effect on users of sv_setsv_flags() that have more complex
types.