This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
optimise $ref1 = $ref2 better
When assigning to a ref, the old referent is mortalised if its refcount
is 1, to avoid a premature free on things like $r = $$r or $r = $r->[0].
For the shortcut case where $ref1 and $ref2 are simple refs (no magic etc)
it's possible to do the assign then SvREFCNT_dec() the old value without
having to mortalise it. Which is faster.
Even when it doesn't have to be mortalised (RC > 1) this commit makes it
slightly faster as it no longer calls sv_unref_flags().
Conversely, this commit also makes the short-cut integer assign code path
infinitesimally slower.