This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
further simplify (??{}) return code
authorDavid Mitchell <davem@iabyn.com>
Sun, 3 Jun 2012 17:45:13 +0000 (18:45 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:32:55 +0000 (13:32 +0100)
commit575c37f6a1d144ae72d75ad22c5fe1a6c3872d6e
treee53a30e3c69e7c961d8dd66202b9cd3c036353cb
parente41ffe51c12c0cad6aa835df69c2ea84774bb0df
further simplify (??{}) return code

This does two things. First, it conflates the RV and non-RV cases; i.e.

    if (ROK) {
        sv = RV(sv)
        if (REGEXP)  rx = sv;
        else if (PERL_MAGIC_qr) rx = mg_obj;
    }
    else {
        if (REGEXP)  rx = sv;
        else if (PERL_MAGIC_qr) rx = mg_obj;
    }

becomes

    if (ROK)
        sv = RV(sv)
    if (REGEXP)  rx = sv;
    else if (PERL_MAGIC_qr) rx = mg_obj;

Secondly, elmininate the intermediate rx var; it's only point in life is
to be assigned to re_sv, so just use re_sv throughout.
regexec.c