summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-20 00:17:15 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-20 12:50:00 -0700
commit85b0ee6ec41030ce5cff3c130bacafa371a14cb9 (patch)
treeb1e405631415d5d44fa8566f366d7d0729da26ee /pp.c
parent3a6ce63afe9bfc9bf645e0c127824d8426a7ee67 (diff)
downloadperl-85b0ee6ec41030ce5cff3c130bacafa371a14cb9.tar.gz
Avoid double stringification in pp_complement
Commit 91bba347 made targets exempt from uninit warnings. The com- mit message only says it has something to do with fixing warnings on bitwise ops. Commit a1afd1046 worked around that by doing an extra stringifica- tion before assigning to the target, to produce an uninit warning on purpose. As far as I can tell, the only purpose of 91bba347 was to avoid the warning for ~undef. (I haven’t actually tried building the commit before that to confirm.) In any case, the uninit warning has been long tested for and is now expected behaviour. Since I am about to remove the uninit warning exemption for targets, stop relying on that. This speed ups the code slightly, as we avoid a double string- ification.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index b61192da2b..8e5ba2be22 100644
--- a/pp.c
+++ b/pp.c
@@ -2315,9 +2315,8 @@ PP(pp_complement)
I32 anum;
STRLEN len;
- (void)SvPV_nomg_const(sv,len); /* force check for uninit var */
- sv_setsv_nomg(TARG, sv);
- tmps = (U8*)SvPV_force_nomg(TARG, len);
+ sv_copypv_nomg(TARG, sv);
+ tmps = (U8*)SvPV_nomg(TARG, len);
anum = len;
if (SvUTF8(TARG)) {
/* Calculate exact length, let's not estimate. */