summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-10 08:02:55 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-10 08:02:55 +0000
commit86173d902c03e4de5d1e5e2acd88d8a6bb5a0015 (patch)
treedff953e4b7d4d91df37faffacbfcf85def7b5a37 /pp_hot.c
parent532ffc5d12f1c363c9c70bfcf166e7ed040fdbd4 (diff)
downloadperl-86173d902c03e4de5d1e5e2acd88d8a6bb5a0015.tar.gz
If doing rcatline no point rescanning each time
the beginning of the SV for utf8 validity. p4raw-id: //depot/perl@21155
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 1de483c3fa..0c4c692016 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1570,10 +1570,12 @@ Perl_do_readline(pTHX)
RETURN;
}
if (SvUTF8(sv)) {
+ U8 *s = (U8*)SvPVX(sv) + offset;
+ STRLEN len = SvCUR(sv) - offset;
U8 *f;
if (ckWARN(WARN_UTF8) &&
- !Perl_is_utf8_string_loc(aTHX_ (U8*)SvPVX(sv), SvCUR(sv), &f))
+ !Perl_is_utf8_string_loc(aTHX_ s, len, &f))
/* Emulate :encoding(utf8) warning in the same case. */
Perl_warner(aTHX_ packWARN(WARN_UTF8),
"utf8 \"\\x%02X\" does not map to Unicode",