This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
include SvREADONLY() in SvIMMORTAL() test
SvIMMORTAL() is currently defined as
((sv)==&PL_sv_undef || (sv)==&PL_sv_yes
|| (sv)==&PL_sv_no || (sv)==&PL_sv_placeholder)
Which is relatively slow. Some places do this:
if (SvREADONLY(sv) && SvIMMORTAL(sv)) ...
which quickly rejects most times.
This commit simply moves the SvREADONLY test into the SvIMMORTAL macro
so that *all* uses benefit from this speedup.