From: Nicholas Clark Date: Wed, 26 Mar 2008 18:59:03 +0000 (+0000) Subject: Don't call S_utf8_mg_pos_cache_update(), and hence don't even create X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=efcbbafbf10077e558f8e3e69fc9ffdd50d0924f;p=p5sagit%2Fp5-mst-13.2.git Don't call S_utf8_mg_pos_cache_update(), and hence don't even create the magic for the UTF-8 cache, if the UTF-8 caching is disabled. p4raw-id: //depot/perl@33579 --- diff --git a/sv.c b/sv.c index ce6c3f7..e800bd7 100644 --- a/sv.c +++ b/sv.c @@ -5882,7 +5882,8 @@ S_sv_pos_u2b_cached(pTHX_ SV *const sv, MAGIC **const mgp, const U8 *const start boffset = real_boffset; } - S_utf8_mg_pos_cache_update(aTHX_ sv, mgp, boffset, uoffset, send - start); + if (PL_utf8cache) + utf8_mg_pos_cache_update(sv, mgp, boffset, uoffset, send - start); return boffset; } @@ -6237,7 +6238,8 @@ Perl_sv_pos_b2u(pTHX_ register SV *const sv, I32 *const offsetp) } *offsetp = len; - S_utf8_mg_pos_cache_update(aTHX_ sv, &mg, byte, len, blen); + if (PL_utf8cache) + utf8_mg_pos_cache_update(sv, &mg, byte, len, blen); } /*