Optimise magic handling in save* and leave_scope
authorDavid Mitchell <davem@iabyn.com>
Thu, 29 Nov 2012 11:37:08 +0000 (11:37 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 4 Dec 2012 10:22:20 +0000 (10:22 +0000)
commitb492a59ed90fecea7508c6bc9601fb08e0212721
tree2ffd98b7627093fd896f40ee77ace420f4d684e8
parent03dba56127506a6979ee0298da57d71840dee39d
Optimise magic handling in save* and leave_scope

There are several places that have code similar to

    if (SvMAGICAL(sv)) {
        PL_localizing = 2;
        SvSETMAGIC(sv)
        PL_localizing = 0;
    }

The condition is sub-optimal (it should only test for set magic), and the
SvSETMAGIC repeats a similar test.
Other places didn't have the outer condition, so they set PL_localizing
twice even when not needed.
scope.c