From: Nick Ing-Simmons Date: Tue, 2 Jan 2001 22:03:06 +0000 (+0000) Subject: Turn SvUTF8 off if not required in pp_chr and pp_stringify. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a227d84de924cb415af5426df5a1096840ffba31;p=p5sagit%2Fp5-mst-13.2.git Turn SvUTF8 off if not required in pp_chr and pp_stringify. p4raw-id: //depot/perlio@8298 --- diff --git a/pp.c b/pp.c index d79c170..950d85a 100644 --- a/pp.c +++ b/pp.c @@ -1268,7 +1268,7 @@ PP(pp_subtract) if (SvIOK(TOPm1s)) { bool auvok = SvUOK(TOPm1s); bool buvok = SvUOK(TOPs); - + if (!auvok && !buvok) { /* ## IV - IV ## */ IV aiv = SvIVX(TOPm1s); IV biv = SvIVX(TOPs); @@ -1298,7 +1298,7 @@ PP(pp_subtract) UV auv = SvUVX(TOPm1s); UV buv = SvUVX(TOPs); IV result; - + if (auv >= buv) { SP--; SETu( auv - buv ); @@ -1415,7 +1415,7 @@ PP(pp_lt) if (SvIOK(TOPm1s)) { bool auvok = SvUOK(TOPm1s); bool buvok = SvUOK(TOPs); - + if (!auvok && !buvok) { /* ## IV < IV ## */ IV aiv = SvIVX(TOPm1s); IV biv = SvIVX(TOPs); @@ -1493,7 +1493,7 @@ PP(pp_gt) if (SvIOK(TOPm1s)) { bool auvok = SvUOK(TOPm1s); bool buvok = SvUOK(TOPs); - + if (!auvok && !buvok) { /* ## IV > IV ## */ IV aiv = SvIVX(TOPm1s); IV biv = SvIVX(TOPs); @@ -1571,7 +1571,7 @@ PP(pp_le) if (SvIOK(TOPm1s)) { bool auvok = SvUOK(TOPm1s); bool buvok = SvUOK(TOPs); - + if (!auvok && !buvok) { /* ## IV <= IV ## */ IV aiv = SvIVX(TOPm1s); IV biv = SvIVX(TOPs); @@ -1649,7 +1649,7 @@ PP(pp_ge) if (SvIOK(TOPm1s)) { bool auvok = SvUOK(TOPm1s); bool buvok = SvUOK(TOPs); - + if (!auvok && !buvok) { /* ## IV >= IV ## */ IV aiv = SvIVX(TOPm1s); IV biv = SvIVX(TOPs); @@ -1727,7 +1727,7 @@ PP(pp_ne) if (SvIOK(TOPm1s)) { bool auvok = SvUOK(TOPm1s); bool buvok = SvUOK(TOPs); - + if (!auvok && !buvok) { /* ## IV <=> IV ## */ IV aiv = SvIVX(TOPm1s); IV biv = SvIVX(TOPs); @@ -2621,7 +2621,7 @@ PP(pp_abs) { /* This will cache the NV value if string isn't actually integer */ IV iv = TOPi; - + if (SvIOK(TOPs)) { /* IVX is precise */ if (SvIsUV(TOPs)) { @@ -2637,7 +2637,7 @@ PP(pp_abs) IV_MIN and -IV_MIN should both be %100...00 and NV-able */ SETu(IV_MIN); } - } + } } } else{ NV value = TOPn; @@ -2969,6 +2969,9 @@ PP(pp_chr) XPUSHs(TARG); RETURN; } + else { + SvUTF8_off(TARG); + } SvGROW(TARG,2); SvCUR_set(TARG, 1); @@ -3535,7 +3538,7 @@ PP(pp_hslice) DIE(aTHX_ PL_no_helem, SvPV(keysv, n_a)); } if (PL_op->op_private & OPpLVAL_INTRO) { - if (preeminent) + if (preeminent) save_helem(hv, keysv, svp); else { STRLEN keylen; diff --git a/pp_hot.c b/pp_hot.c index 9d4d6b0..24ae7bb 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -78,6 +78,8 @@ PP(pp_stringify) sv_setpvn(TARG,s,len); if (SvUTF8(TOPs) && !IN_BYTE) SvUTF8_on(TARG); + else + SvUTF8_off(TARG); SETTARG; RETURN; }