pp_ncmp() and pp_scmp() should return numeric values, not booleans.
Jarkko Hietaniemi [Mon, 26 Mar 2001 22:01:18 +0000 (22:01 +0000)]
Really need to benchmark this.

p4raw-id: //depot/perl@9370

pp.c

diff --git a/pp.c b/pp.c
index 3372428..a79a1d4 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1786,7 +1786,7 @@ PP(pp_ncmp)
     dSP; dTARGET; tryAMAGICbin(ncmp,0);
 #ifndef NV_PRESERVES_UV
     if (SvROK(TOPs) && SvROK(TOPm1s)) {
-       SETs(boolSV(SvRV(TOPs) == SvRV(TOPm1s)));
+       SETi(PTR2UV(SvRV(TOPs)) - PTR2UV(SvRV(TOPm1s)));
        RETURN;
     }
 #endif
@@ -1972,7 +1972,7 @@ PP(pp_scmp)
     dSP; dTARGET;  tryAMAGICbin(scmp,0);
 #ifndef NV_PRESERVES_UV
     if (SvROK(TOPs) && SvROK(TOPm1s)) {
-       SETs(boolSV(SvRV(TOPs) == SvRV(TOPm1s)));
+       SETi(PTR2UV(SvRV(TOPs)) - PTR2UV(SvRV(TOPm1s)));
        RETURN;
     }
 #endif