diff options
author | David Mitchell <davem@iabyn.com> | 2011-06-21 14:40:12 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-06-25 09:28:17 +0100 |
commit | 69cb655bad9945c212e3b4016966ad8d90dfae8a (patch) | |
tree | 23b98249a9689bef994bf83a2fa6850e8ddb1565 /pp_hot.c | |
parent | 1530afd8d16650b8c823c463ac078ead72dce7fd (diff) | |
download | perl-69cb655bad9945c212e3b4016966ad8d90dfae8a.tar.gz |
remove unreachable code from various compare ops
All the compare ops (such as pp_le), have an initial:
tryAMAGICbin_MG(le_amg, AMGf_numeric);
The effect of the AMGf_numeric flag is that, if the le overloading fails,
but either of the args on the stack is a reference, then that arg is
replaced with a temporary non-ref arg that is either the result of
'0+' overloading, or is a UV with the numerical value of the ref's
address. So by the time the main body of the op is called, neither arg
can be a ref.
Thus a whole bunch of nearly identical blocks can be removed, which *used*
to handle comparing refs:
if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) {
SP--;
SETs(boolSV(SvRV(TOPs) <= SvRV(TOPp1s)));
RETURN;
}
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -342,13 +342,6 @@ PP(pp_eq) { dVAR; dSP; tryAMAGICbin_MG(eq_amg, AMGf_set|AMGf_numeric); -#ifndef NV_PRESERVES_UV - if (SvROK(TOPs) && !SvAMAGIC(TOPs) && SvROK(TOPm1s) && !SvAMAGIC(TOPm1s)) { - SP--; - SETs(boolSV(SvRV(TOPs) == SvRV(TOPp1s))); - RETURN; - } -#endif #ifdef PERL_PRESERVE_IVUV SvIV_please_nomg(TOPs); if (SvIOK(TOPs)) { |