include SvREADONLY() in SvIMMORTAL() test
authorDavid Mitchell <davem@iabyn.com>
Sat, 12 Jan 2013 10:26:15 +0000 (10:26 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 12 Jan 2013 16:34:40 +0000 (16:34 +0000)
commit3041a168eaf8027c9e376a53450bcb825f527da8
treeca690cb3143ea83f3436b621f8d8a32543482b8a
parentf5d13a25262cb242090ad5e0703cf287e26156db
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.
sv.c
sv.h