summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-11-22 23:10:58 -0700
committerKarl Williamson <khw@cpan.org>2017-12-13 09:44:44 -0700
commit7d5ed5d0f107110d6b559148f4f68a8dd26aee46 (patch)
tree3e65bfa2ed2fc8f46ce6e115531fcb1b7f642ff2 /pp_hot.c
parent37e6bbd906410b2b8aa9d9acaa9496d3d5a88949 (diff)
downloadperl-7d5ed5d0f107110d6b559148f4f68a8dd26aee46.tar.gz
pp_multiconcat() Use faster UTF-8 variant counting
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 87e60970d6..100ae39b07 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -814,8 +814,7 @@ PP(pp_multiconcat)
* length on utf8 args (which was only needed to flag non-utf8
* args in this loop */
for (svpv_p = svpv_buf; svpv_p < svpv_end; svpv_p++) {
- char *p;
- SSize_t len, l, extra;
+ SSize_t len, extra;
len = svpv_p->len;
if (len <= 0) {
@@ -823,11 +822,8 @@ PP(pp_multiconcat)
continue;
}
- p = svpv_p->pv;
- extra = 0;
- l = len;
- while (l--)
- extra += !UTF8_IS_INVARIANT(*p++);
+ extra = variant_under_utf8_count((U8 *) svpv_p->pv,
+ (U8 *) svpv_p->pv + len);
if (UNLIKELY(extra)) {
grow += extra;
/* -ve len indicates special handling */