diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-01 05:47:40 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-01 12:41:00 -0700 |
commit | 279b35adf32a369d98486e3ddcd7975d2e1863ab (patch) | |
tree | 824e5a7387107e162180a0ee8f017309d76e5609 /toke.c | |
parent | 4eb074c0459a3ee3a99f42d0354e1792b554d53c (diff) | |
download | perl-279b35adf32a369d98486e3ddcd7975d2e1863ab.tar.gz |
toke.c:S_tokeq: remove dead code
The argument passed to tokeq is always a plain string owning its own
buffer. I checked all the callers.
This code has been like this since perl 5.000.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -2513,18 +2513,17 @@ S_tokeq(pTHX_ SV *sv) char *s; char *send; char *d; - STRLEN len = 0; SV *pv = sv; PERL_ARGS_ASSERT_TOKEQ; - if (!SvLEN(sv)) - goto finish; - - s = SvPV_force(sv, len); + assert (SvPOK(sv)); + assert (SvLEN(sv)); + assert (!SvIsCOW(sv)); if (SvTYPE(sv) >= SVt_PVIV && SvIVX(sv) == -1) goto finish; - send = s + len; + s = SvPVX(sv); + send = SvEND(sv); /* This is relying on the SV being "well formed" with a trailing '\0' */ while (s < send && !(*s == '\\' && s[1] == '\\')) s++; @@ -2532,7 +2531,8 @@ S_tokeq(pTHX_ SV *sv) goto finish; d = s; if ( PL_hints & HINT_NEW_STRING ) { - pv = newSVpvn_flags(SvPVX_const(pv), len, SVs_TEMP | SvUTF8(sv)); + pv = newSVpvn_flags(SvPVX_const(pv), SvCUR(sv), + SVs_TEMP | SvUTF8(sv)); } while (s < send) { if (*s == '\\') { |