develooper Front page | perl.perl5.porters | Postings from November 2005

[PATCH] Remove redundant SvUTF8_on() calls

Thread Next
From:
Gisle Aas
Date:
November 30, 2005 09:29
Subject:
[PATCH] Remove redundant SvUTF8_on() calls
Message ID:
lrhd9uhwo9.fsf@caliper.activestate.com
do_sprintf() and sv_catsv() will already turn their first argument's
SvUTF8 on when required.  Patch relative to blead:

--- pp.c.orig	2005-11-30 15:44:09.000000000 +0100
+++ pp.c	2005-11-30 15:44:24.000000000 +0100
@@ -3228,8 +3228,6 @@
     dSP; dMARK; dORIGMARK; dTARGET;
     do_sprintf(TARG, SP-MARK, MARK+1);
     TAINT_IF(SvTAINTED(TARG));
-    if (DO_UTF8(*(MARK+1)))
-	SvUTF8_on(TARG);
     SP = ORIGMARK;
     PUSHTARG;
     RETURN;
--- sv.c.orig	2005-11-30 15:35:01.000000000 +0100
+++ sv.c	2005-11-30 15:35:59.000000000 +0100
@@ -7978,8 +7978,6 @@
 	}
 	else if (svix < svmax) {
 	    sv_catsv(sv, *svargs);
-	    if (DO_UTF8(*svargs))
-		SvUTF8_on(sv);
 	}
 	return;
     }
@@ -7987,8 +7985,6 @@
 		pat[1] == '-' && pat[2] == 'p') {
 	argsv = va_arg(*args, SV*);
 	sv_catsv(sv, argsv);
-	if (DO_UTF8(argsv))
-	    SvUTF8_on(sv);
 	return;
     }
 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About