diff options
author | Karl Williamson <khw@cpan.org> | 2017-11-22 23:10:58 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-12-13 09:44:44 -0700 |
commit | 7d5ed5d0f107110d6b559148f4f68a8dd26aee46 (patch) | |
tree | 3e65bfa2ed2fc8f46ce6e115531fcb1b7f642ff2 | |
parent | 37e6bbd906410b2b8aa9d9acaa9496d3d5a88949 (diff) | |
download | perl-7d5ed5d0f107110d6b559148f4f68a8dd26aee46.tar.gz |
pp_multiconcat() Use faster UTF-8 variant counting
-rw-r--r-- | pp_hot.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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 */ |